Jump to content

Search terms in URL


richardjh

Recommended Posts

I have a simple script which searches the site on a given keyword. The keyword from the form is sent to the script via 'GET' thus:

 

$keyword = $_GET['keyword'];

 

the script simply queries the database for terms thus :

 

%keyword%

 

 

All seems to work fine apart from if the entered keyword contains an appostrophie. So if I entered:

 

O'Neill

 

into the search box (I know this term exists), the url looks like this:

http://mysite.com/search.php?keyword=O%27Neill&choose=person

...and the script can't find a match.

 

If I enter just Neill (without the O' ) then it finds it fine.

 

I've tried str_replace.

 

how can I approach this?

 

thanks

R

Link to comment
https://forums.phpfreaks.com/topic/97715-search-terms-in-url/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.