$tscore = $_SESSION['score']; $tlevel = $_SESSION['level_no']; $tname = $_SESSION['username']; $sqlimage = "SELECT * FROM `questions` WHERE level_no='{$tlevel}' "; $resultimage = mysql_query($sqlimage) or die(mysql_error()); $rowimage = mysql_fetch_assoc($resultimage); $image = "question/" . $rowimage['qname']; $update_sql = "update users set score='{$tscore}',level_no='{$tlevel}', date_time = now() where anokhaid='{$anoid}'"; $returnval = mysql_query($update_sql); if ($tlevel > 123) { header('Location: congrats.html'); } else { header('Location: success.php?id=' . $ans . '&&key=' . keymaker($ans) . ''); } } else { header('Location: wrong.php?id=' . $ans . '&&key=' . keymaker($ans) . ''); } } } else { header('Location: index.php'); } ?> <html> <head> <script src="jquery.js" type="text/javascript"></script> <script src="min.js" type="text/javascript"></script> <script src="modernizr.custom.js"></script> <script> var ans = "<?php echo $hint1;
<?php function keymaker($id) { $secretkey = 'hfaa1h1awhqa3sdoyasw7e2sho3mqeojemdw09jdsklafjp1qwoijedmp03w9eiojdma'; $key = md5($id . $secretkey); return $key; } $testurlkey = keymaker($_GET['id']); if (isset($_GET['id']) && $testurlkey == $_GET['key']) { $dir = 'img/answer_right/'; $images = scandir($dir); $i = rand(2, sizeof($images) - 1); $img = 'img/answer_right/' . $images[$i]; } else { header('Location: homepage.php'); } ?> <head> <link rel="icon" href="img/anokha-logo.ico" type="image/x-icon"> <style> .question{ top: 100px; position: relative; } .btn{ height:40px; background:#2f4f4f; opacity:0.5; color:white; border-style:solid;