查看: 876|回复: 4
|
PHP WAP issue
[复制链接]
|
|
hello everyone,
Good morning to all the high tech. person out there. Recently, small student is trying to implement WAP language using APACHE PHP MYSQL, WAP, in Windows XP system SP2. The WAP browser I installed on Windows is: KLONDITE WAP BROWSER 1.5 PE edition.
I configure the .htaccess file to add file type for apache to recommend the .WML file extension, which is in a file called a.htaccess, and their substance are:
#hash is a comment used to describe function in .htaccess
#this .htaccess file will be used to configure the apache to read .wml files
#there is 2 method that is used to configure apache to read the .wml files
#one is through httpd.conf, and another is through .htaccess files
#Reference of information take was from: http://www.zend.com/zend/tut/wap.php#Heading9
# MIME Types for WAP
# For PHP 4.x, use this:
AddType application/x-httpd-php .wml
# For PHP 3.x, use this:
AddType application/x-httpd-php3 .wml
# For normal WML pages.
AddType text/vnd.wap.wml .wml
# For WML embedded graphics.
AddType image/vnd.wap.wbmp .wbmp
# End MIME Types for WAP
Then what I wrote:::
<?php
// send wml headers
header("Content-type: text/vnd.wap.wml"
echo "<?xml version=\"1.0\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""
. " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
?>
<wml>
<card>
<?php
$the_date = date("Y-m-d"
print $the_date;
print "<br/>Welcome to a PHP-enabled site!";
?>
</card>
</wml>
The startup process is fine, but when I compile it, it has something like an error, that couldn't read PHP syntax, can anybody help?? The screen display is some how like this:::
Welcome to a PHP-enabled site!"; ?>
I found that It couldn't detect PHP language syntax, was it the wrong with browser compatibility?
I even try to configure the server to recognize by throwing the htaccess file and copy the content into the httpd.conf file like this
[::The last few line::]
ScriptAlias /php/ "c:/PHP/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
#my WAP
AddType application/x-httpd-php .wml
AddType application/x-httpd-php3 .wml
AddType text/vnd.wap.wml .wml
AddType image/vnd.wap.wbmp .wbmp
Anybody could help me, it's interesting la, hahahaha hope somebody tech savvy could show up helping me..
|
|
|
|
|
|
|
|
发表于 11-9-2006 01:12 AM
|
显示全部楼层
to test is your php in apache working or not, use phpinfo(); in normal .php file running by IE, then try running at KLONDITE. at last change .php to .wml and try running at KLONDITE |
|
|
|
|
|
|
|
楼主 |
发表于 11-9-2006 06:56 PM
|
显示全部楼层
原帖由 8years 于 11-9-2006 01:12 AM 发表
to test is your php in apache working or not, use phpinfo(); in normal .php file running by IE, then try running at KLONDITE. at last change .php to .wml and try ....
hi ,
My php is working, the issue is with running PHP on WML, and basically on mobile browser I don't think it will run php, if you installed Apache and run the mobile browser - for e.g. KLONDITE / Win Wap for Windows, it will show you bunch of errors
in mozilla or other standard browser the screen are ok like below: running http://localhost
If you use mobile browser such as winwap for windows it will look like this: running http://localhost
If you intend to run php_info(); it will look something like this, i think there's some concern on the content typpe header:
(in this case the winwap browser will ask you whether to open the file using default browser yes/ no
if you choose yes mozilla will open(my default browser, if you choose no, it willa ask you to save changes, otherwise you click on cancel it will show you this)
Anybody can help me??? Getting crazy of this already |
|
|
|
|
|
|
|
楼主 |
发表于 15-9-2006 09:01 PM
|
显示全部楼层
anybody able to help me bo?? |
|
|
|
|
|
|
|
发表于 18-9-2006 01:13 AM
|
显示全部楼层
seens like wap explorer doesnt support some html code, maybe you need to read more detail about wap explorer. see what language wap explorer can parse. |
|
|
|
|
|
|
| |
本周最热论坛帖子
|