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?
PHP WML
Moderator: General Moderators
Dependant on your version of PHP try (in auth.php):
For debugging use var_dump().
Regards,
Code: Select all
<?php
echo "Name ". $_POST['name']. "<br />";
echo "Pin ". $_POST['pin'];
?>Regards,
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,
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,
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">");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>
<?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>