0

my website theme has an Ajax search bar. My search bar does not seem to work properly when searching for products containing apostrophes and quotes in the title.

Example:

Title of a product is 4'x4' Grow Tent I will type 4' into my live search bar, and when I click on the actual product that shows up in the dropdown live search bar, I am directed to a page saying "No products found".

Any ideas? I've been searching for days with no luck.

0

Try to apply some function like htmlspecialchars() on your query before searching for it, it will translate your special chars into HTML entities.

1
  • Escaping will also increase the security of your code. – luke Apr 29 '15 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.