Extra single quote:
$serverquery = $_SERVER['QUERY_STRING']';
should be:
$serverquery = $_SERVER['QUERY_STRING'];
So, try this:
$serverquery = $_SERVER['QUERY_STRING'];
$result = mysql_query("SELECT * FROM products WHERE ProductType='".$serverquery."'",$db);
if (mysql_num_rows($result) > 0) {
header("location: producttypes.php?type=".$serverquery);
And, to answer your question; if you had the magic quotes thing (for lack of a better term at the moment) off, and had no validation, I could delete your entire database, and any others, assuming I knew their name or was good at guessing.