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

Apostrophe screwing up the Link

Status
Not open for further replies.

Nina2001

Programmer
Dec 28, 2001
58
US
Hi. I have a php page that searches and displays songs from a song database.


The categories of "70's" and "80's" are the only ones I get a page result problem so I'm thinking it must have something to do with the apostrophe. This is the first result page which placed a %27 in the link instead of the '.


From this page if you do the next page link button the link starts getting slashes in it. Does anyone know what I can do to fix this?

Example of the link after hitting the next button twice.
 
Try to wrap the url into htmlentities() or urlencode(). URL entities werent meant to have apostrophies in them, and it is trying to convert them as a result of that. Of course if you really want to make it easy on yourself, dont create anything with apostrophies. To bring it back out of the encode level, take your get variables inside of the script you pass it to and run them inside of the urldecode() function.
 
I finally got it. This was all I needed.

$category_search=stripslashes($category);

After an hour of attempts....what a pain.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top