fmwebschool
asked on
Using WML to pass a variable to a second page
I have created a page for user input. There is only one input value, and this displays just fine.
Page1
<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="form1">
<p>
Company Name: <input title="user" name="company" />
<anchor>
Login
<go href="http://65.65.65.131/wireless/search.wml" method="post">
<postfield name="company" value="$(company)"/>
</go>
</anchor>
</p>
</card>
</wml>
The receiving page, gives me a 'This page can not be displayed' error. If I then refresh the response page (search.wml), it does load the page, however the value passed is not displayed.
Page 2
<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="form1">
<p>
<?php
echo 'Company: ';
echo $_POST['company'];
?>
</p>
</card>
</wml>
Is there something else that needs to be done to pass a value to a separate page. I will eventually be using this value ot query a database using PHP and therefore cannot just use separate cards in the same wml document.
Thanks so much,
Stephen
Page1
<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="form1">
<p>
Company Name: <input title="user" name="company" />
<anchor>
Login
<go href="http://65.65.65.131/wireless/search.wml" method="post">
<postfield name="company" value="$(company)"/>
</go>
</anchor>
</p>
</card>
</wml>
The receiving page, gives me a 'This page can not be displayed' error. If I then refresh the response page (search.wml), it does load the page, however the value passed is not displayed.
Page 2
<?xml version="1.0"?><!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="form1">
<p>
<?php
echo 'Company: ';
echo $_POST['company'];
?>
</p>
</card>
</wml>
Is there something else that needs to be done to pass a value to a separate page. I will eventually be using this value ot query a database using PHP and therefore cannot just use separate cards in the same wml document.
Thanks so much,
Stephen
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER