Page 1 of 1

PHP WML

Posted: Tue Jul 22, 2003 1:04 am
by asvur
Hi.

I am trying to send two variables from login.wml to auth.php.
But auth.php gets empty variables.

here is the code for login.wml:


<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card newcontext="true" title="Fuhrpark Login" id="login">
<p>
<fieldset title="name & PIN">
Name:
<input name="name"
type="text"/><br/>
Password:
<input name="pin"
type="password"/>
</fieldset>
<anchor>
Login
<go method="post" href="auth.php" >
<postfield name="name" value="$nameeingeben"/>
<postfield name="pin" value="$pineingeben"/>
</go>
</anchor>
<do type="accept"
label="Login">
<go method="post" href="auth.php" >
<postfield name="name" value="$nameeingeben"/>
<postfield name="pin" value="$pineingeben"/>
</go>
</do>
</p>
</card>
</wml>

and here is the code for auth.php:

<?php
echo ("Name $name");
echo ("Pin $pin");
?>

What do i wrong?
Please can you help me?

Posted: Tue Jul 22, 2003 2:45 am
by cactus
Dependant on your version of PHP try (in auth.php):

Code: Select all

<?php 
echo "Name ". $_POST['name']. "<br />"; 
echo "Pin ". $_POST['pin']; 
?>
For debugging use var_dump().

Regards,

Posted: Tue Jul 22, 2003 4:32 am
by asvur
it does not work
:-(
What to do now?

Posted: Tue Jul 22, 2003 8:18 am
by cactus
What do you actually see ?

Is the "auth.php" also meant to be a WAP page ? If so, you need to ensure any output is wrapped in appropriate WML tags.

Are you throwing the correct MIME type ?

What are you using to test the page ?

Regards,

Posted: Wed Jul 23, 2003 4:17 am
by asvur
I see:

Name
Pin

and nothin more
$name and$pin is empty:-(

Is the "auth.php" also meant to be a WAP page ? If so, you need to ensure any output is wrapped in appropriate WML tags.

first i want to write out the variables.laterr auth.php will be a WAP page.

Are you throwing the correct MIME type ?
what do you mean with this question. i am a newbie and do not understand that. sorry

What are you using to test the page ?
I am using Opera web Browser. This Browser can read html and wml pages.

Regards,

Posted: Fri Aug 01, 2003 6:29 am
by keitai
try using

Code: Select all

// 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">");

Posted: Mon Nov 10, 2003 4:49 am
by dardarlt
Try this login form - it work fine form me ;)

<?php
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 id="_LOGIN" title="_LOGIN">
<p>
_USERNAME:
<input title="_USERNAME" name="user"/> <br/>
_PASSWORD:
<input title="_PASSWORD" type="password" name="password"/> <br/>
<do type="accept" label="_LOGIN"><go href="add_link.wml?us=$(user)&pass=$(password)"></go></do>
<anchor>
_LOGIN
<go href="add_link.wml?us=$(user)&pass=$(password)"></go>
</anchor><br/>
<a href="signup.wml">_SIGNUP_FOR_ACOUNT </a>
</p>
</card>
</wml>