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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A quite interesting question I guess...

Status
Not open for further replies.

Sleidia

Technical User
May 4, 2001
1,284
FR
Hello.

I got a problem I'm surprized nobody is talking about:

When doing this:
<a href=\&quot;show_only.php?a=$brand_name&b=$product&c=$price\&quot; target=\&quot;_top\&quot;>link</a>

What if there is an & (&amp;) in the records.
(such as the data Smith&Smith in $brand_name for example).

Thanks a lot.
 
Obviously, if you have non alph-numberic characters in your URL string, you can interfere with the transmission of data. This is the reason for urlencoding.

If you are using PHP, it's quite simple: just use the built in urlencode($variable) function, which will tranlate any offending characrters into the URL-transmittable character codes. PHP automaticaly decodes these variables in the receiving script. See
If you are using Perl, or ASP, or any other web programming language, each has modules or routines to accomplish this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top