Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

querystring value not sent properly

Status
Not open for further replies.

vasox56

Technical User
May 8, 2007
75
GB
im having trouble sending a value to another page using querystring..

the value is:

Elephant & Castle

when i load this value from my database and display it on my first page, it displays correctly using the following:

Code:
<%= rs("placeNAME")%>
i try to send that string to another page as Postcode using this script

Code:
<form action="online-booking1.asp?Price=<%=sTempVar & "163;" & trim(rs("salPRICE"))%>&amp;Postcode=<%= rs("placeNAME")%>&amp;FCar=Saloon" method="post">

my second page receives the value like so:
Code:
zpostcode = Request.QueryString("Postcode")
and displays the value using
Code:
<%=(zpostcode)%>

the problem is.. Elephant & Castle is only displaying as Elephant on the new page

it is cutting off part of the string after the &

i dont whether i have to prepare the variable in the form action code before it leaves the page.. or grab the whole string when the value arrives at second page.

can someone help me.. thanks.
 
is this on the right track??





Code:
<form action="online-booking1.asp?Price=<%=sTempVar & "163;" & trim(rs("salPRICE"))%>[b]&amp;Postcode=Server.URLEncode + <%= rs("placeNAME")%>[/b]&amp;FCar=Saloon" method="post">
 
You are still not URLEncoding the variable. So, no, it won't work.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
&amp; is an HTML encoding escape.

Check out the link posted above from a few days ago, same exact issue with a solution.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top