= (SELECT FLOOR( MAX(id) * RAND()) FROM files ) ORDER BY id LIMIT 1"; $sql = mysql_query($query); $row = mysql_fetch_array($sql); $result = mysql_query("SELECT * FROM files"); $num_rows = mysql_num_rows($result); $quicklink = $row[quicklink]; $nextimage = "http://clikr.co/". $quicklink; // This replicates register_globals in PHP 5.4+ foreach (array_merge($_GET, $_POST) as $key => $val) { global $$key; $$key = addslashes($val); } ?> clikr - the awesome random image sharing site