Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


"&" in querystrings?

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,147
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> "&" in querystrings?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 "&" in querystrings? - 6/9/2001 1:42:26 AM   
  anton

 

Posts: 11
Score: 0
Joined: 6/9/2001
From: USA
Status: offline
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,"&","&")

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

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


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.
 
 
Post #: 1
 
 Re: "&" in querystrings? - 6/9/2001 1:44:29 AM   
  rahul27

 

Posts: 19
Score: 0
Joined: 5/23/2001
From: India
Status: offline
You could maybe use the Chr() function to pass the
& as an ascii code ?

& is Chr(38)

(in reply to anton)
 
 
Post #: 2
 
 Re: "&" in querystrings? - 6/9/2001 1:46:06 AM   
  anton

 

Posts: 11
Score: 0
Joined: 6/9/2001
From: USA
Status: offline
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.

(in reply to anton)
 
 
Post #: 3
 
 Re: "&" in querystrings? - 6/9/2001 1:48:01 AM   
  century

 

Posts: 10
Score: 0
Joined: 6/7/2001
From: USA
Status: offline
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.

(in reply to anton)
 
 
Post #: 4
 
 Re: "&" in querystrings? - 6/9/2001 1:49:22 AM   
  mid

 

Posts: 16
Score: 0
Joined: 6/4/2001
From: USA
Status: offline
Try using server.urlencode

(in reply to anton)
 
 
Post #: 5
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> "&" in querystrings? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts