Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.