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!

"&" in querystrings? 2

Status
Not open for further replies.

anthonycervantes

Programmer
Oct 25, 2000
9
0
0
US
I am trying to pass email addresses via a querysting. The problem is if I have an email address that has a "&" it does work right. I have tried all these before it is put into the querystring:

frm.txtEmail.value = replace(frm.txtEmail.value,"&","&")

frm.txtEmail.value = replace(frm.txtEmail.value,"&","&amp")

frm.txtEmail.value = replace(frm.txtEmail.value,"&","'&'")

frm.txtEmail.value = replace(frm.txtEmail.value,"&","'&amp'")


and it still doesn't work. I am at a loss. I know that the browser sees the & and thinks it is concantinating whatever was next to it. Help, please.

AC
 
You could maybe use the Chr() function to pass the
& as an ascii code ?

& is Chr(38)

Peter
 
I tried that and it passed through and saved but it is now passed as "ch(38)" literally. Now the email address is saved as firstch(38)last@mail.com. I need it to be saved from the querystring as first&last@mail.com. This is a start. I will see if I can do some kind of search and replace in the stored proc. to take the ch(38) and turn it back into &. If you have any suggestions on how to do that using SQL 2000 that would be a great help. Thanks.
 
using javascript, you can use:

document.escape(somestr)

and it will prepare it for use in a querystring, then you just unescape it on the other side. jared@aauser.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top