954,580 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Percent sign problem in URL

hello i have a problem with the % sign in to the url links

for example my url is

http://www.site.com/1411/The-trafic-is-increased-to-20%-this-year


that % is used like a variable in browsers and is not clickable in IE 8 or it gives errors in others browsers!

removing % is not an option because the url is used for the title [ The trafic is increased to 20% this year ]..

i try to use ascii % but is not working because the link in the href="" is tranformed with % inside!

somebody knows how to escape % (PERCENT SIGN) in to the URL and not being used like a variable by the browsers?

Squit
Newbie Poster
24 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 
pritaeas
Posting Expert
Moderator
5,483 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

thanks pritaeas, but i don't like urlencode :D maybe is some other option to escape % like an escape char \% ?

Squit
Newbie Poster
24 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

Manually replace % with %25

pritaeas
Posting Expert
Moderator
5,483 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 
thanks pritaeas, but i don't like urlencode :D maybe is some other option to escape % like an escape char \% ?


What about encoding whole url part after 1411 with base64encode

evstevemd
Senior Poster
3,713 posts since Jun 2007
Reputation Points: 462
Solved Threads: 392
 

thanks ppl, i found the escape char wich is #% and works perfectly! i use only str_replace, using urlencode or other function like base64encode make links not so friendly with users thats the reason i don't want to use it. Thanks!

Squit
Newbie Poster
24 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: