Jump to content
  • Advertisement
Sign in to follow this  
LinkOfTime

Hi all, one more WAP question :)

This topic is 5409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all This time, I am having difficulties in saving an input selection in an ASP variable. Here is the code: <?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="Card 1">

What is your name:<br/> <select name="UserName"> <option value="Alon">Alon</option><br/> <option value="Matan">Matan</option><br/> <option value="Eran">Eran</option> </select><br/> <anchor> Send <go href="#card2"/> </anchor>

</card> <card id="card2">

Your name is: $(UserName)<br/> <%Dim UserName2%> <%UserName2=$(UserName)%> <%=UserName2%>A

</card> </wml> I am trying to save the input "UserName" into the variable "UserName2" and it's not working. I have tried to write something like: <%UserName2=request.querystring("UserName")%> or <%UserName2=request.form("UserName")%> but none worked. Please help... Thanks in advanced :)

Share this post


Link to post
Share on other sites
Advertisement
You're mixing the client side WML with the server side ASP. You can't do that. The phone has no way of running the ASP script. If you want to send data from the phone to the server you need to use a form that posts to an ASP page that can process the data.

So your initial page would be something like:

<?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="Card 1">
What is your name:<br/>
<select name="UserName">
<option value="Alon">Alon</option><br/>
<option value="Matan">Matan</option><br/>
<option value="Eran">Eran</option>
</select><br/>
<do type="accept" label="Send">
<go method="post" href="http://mydomain.com/getusername.asp">
<postfield name="username" value="$(UserName)"/>
</go>
</do>
</card>
</wml>


When the user presses send, the username will be posted to the getusername.asp page, so it could look something like this:

<% Response.ContentType = "text/vnd.wap.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 id="card1" title="Card 1">
Hello <%=Request.Form("username")%>, how are you doing today?
</card>
</wml>


Here's another example, they are doing a search page.

Gmar chatima tova,
shmoove

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by LinkOfTime
Hi again, thanks for answering
I already know ASP so it wouldn't be so hard to use it.

Share this post


Link to post
Share on other sites
Hi
Thanks, it worked
Gmar Hatima Tova to you too (can't say tzom kal, too late for that :), but I hope you did have it kal :) )
Well, thanks again for the help

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!