Ive been working with these files for 5 hours today, ive got nearly all of them sorted but this one is killing me Im getting this error : Code (text): Notice: Undefined index: id in /home/bretr/public_html/freehostout.php on line 4 This is the code : PHP: <?php error_reporting (E_ALL); require_once ("./includes/config.php"); $hostid = $_GET['id']; $getfreehosthits = "SELECT Hits, HostingURL FROM freehosting WHERE HostingId='". $hostid ."'"; $freehosthitsrs = mysql_query($getfreehosthits, $conn) or die (mysql_errno() . ": " . mysql_error()). "\n"; while($freehosthits = mysql_fetch_array($freehosthitsrs)) { $hits = $freehostinghits['Hits']; $url = $freehostinghits['HostingURL']; $newhits = $hits + 1; $updatehits = mysql_query("UPDATE freehosting SET Hits='". $newhits."' WHERE HostingId='". $hostid ."'"); mysql_query($updatehits, $conn); } mysql_free_result($freehosthitsrs); mysql_close($conn); header("Location:". $url. ""); exit(); ?> Any ideas ?
if( isset ( $_GET['id' )) { $hostid = intval( $_GET['id'] ); } Even better - make the isset cover all the query down bellow. And use _at_ _least_ intval if not harder, tighter check to stop'em crooks pwning your site !