I have a search script on my site and I am having issues with it.
If for example i insert the following in the field: <?php echo 'test'; ?>
Instead of performing the normal search I get an error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use..."
How do I fix this, my database contains code examples and such so people could very easily be searching for some php statement or something. Also I don't think it is very secure since it is obviously executing it.
I tried adding the following code but it didn't help.
$search = @strip_tags(htmlspecialchars(stripslashes($_GET['search'])));
If for example i insert the following in the field: <?php echo 'test'; ?>
Instead of performing the normal search I get an error: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use..."
How do I fix this, my database contains code examples and such so people could very easily be searching for some php statement or something. Also I don't think it is very secure since it is obviously executing it.
I tried adding the following code but it didn't help.
$search = @strip_tags(htmlspecialchars(stripslashes($_GET['search'])));







