case 'editprod2' : //validate if (!isset($_GET['id']) || !is_numeric($_GET ['id'])) //added !isset and used !is_numeric { echo "

Invalid product selected!

"; break; } $_GET['id'] = (int)$_GET['id']; $str = "SELECT * FROM products WHERE `prod_id`= ".($_GET['id'])." LIMIT 1"; $qry = mysql_query($str) or die("Invalid prod_id used! [mysql error: ".mysql_error()."]"); if ($row = mysql_fetch_assoc($qry)){ $string = "SELECT * FROM `categories` ORDER BY `cat_id` = ".$_GET['id'].""; $query = mysql_query($string) or die("Invalid prod_id used! [mysql error: ".mysql_error()."]"); echo "Edit Product:
"; ?>
Product Name
Category
Description
Image Upload: Select a file to upload: