cricket23
April 15th, 2007, 08:55
Hello everyone,
I am trying to develop a simple application using WML and PHP.
I've written a simple form in WML which contains two input fields for "name" and "age", and then linked it to a PHP file to retrieve and print the values of these two variables.
I tried to test my WML form using Nokia Mobile Browser 4.0, but I get a "File not found" error. NMB4.0 can't find the PHP file - I have no idea why. :confused4
The code looks like this:
<wml>
<card id="form">
<p align="center">
Name: <br/>
<input name="name"/> <br/>
Age: <br/>
<input name="age"/> <br/>
<anchor>
<go method="get" href="welcome.php">
<postfield name="nume" value="$(name)"/>
<postfield name="varsta" value="$(age)"/>
</go>
Submit!
</anchor>
</p>
</card>
</wml>
and the welcome.PHP file (which is in the same directory as the WML file):
<?php header('Content-type: text/vnd.wap.wml'); ?>
<?php echo '<?xml version="1.0"?'.'>'; ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<card id="card1" title="WML Form">
<p>
Welcome <?php echo $_GET["nume"]; ?>. <br/>
You are <?php echo $_GET["varsta"]; ?> years old. <br/>
</p>
</card>
</wml>
I looked up some examples on the web, and their code looks exactly the same as mine...
Can anyone help me on this?
Thank you all,
Monica.
I am trying to develop a simple application using WML and PHP.
I've written a simple form in WML which contains two input fields for "name" and "age", and then linked it to a PHP file to retrieve and print the values of these two variables.
I tried to test my WML form using Nokia Mobile Browser 4.0, but I get a "File not found" error. NMB4.0 can't find the PHP file - I have no idea why. :confused4
The code looks like this:
<wml>
<card id="form">
<p align="center">
Name: <br/>
<input name="name"/> <br/>
Age: <br/>
<input name="age"/> <br/>
<anchor>
<go method="get" href="welcome.php">
<postfield name="nume" value="$(name)"/>
<postfield name="varsta" value="$(age)"/>
</go>
Submit!
</anchor>
</p>
</card>
</wml>
and the welcome.PHP file (which is in the same directory as the WML file):
<?php header('Content-type: text/vnd.wap.wml'); ?>
<?php echo '<?xml version="1.0"?'.'>'; ?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<card id="card1" title="WML Form">
<p>
Welcome <?php echo $_GET["nume"]; ?>. <br/>
You are <?php echo $_GET["varsta"]; ?> years old. <br/>
</p>
</card>
</wml>
I looked up some examples on the web, and their code looks exactly the same as mine...
Can anyone help me on this?
Thank you all,
Monica.