$value = strtoupper($value); for ($i = 0; $i < strlen($value); $i++) { $hash = ($hash << 5) + $hash + ord(substr($value, $i)); } return $hash; } ?> <html> <head> <title>jQuery Real Person Submission</title> <style type="text/css"> .accepted { padding: 0.5em; border: 2px solid green; } .rejected { padding: 0.5em; border: 2px solid red; } </style> </head> <body> <h1>jQuery Real Person Submission</h1> <?php if (rpHash($_POST['defaultReal']) == $_POST['defaultRealHash']) { ?> <p class="accepted">You have entered the "real person" value correctly and the form has been processed.</p> <?php } else { ?> <p class="rejected">You have NOT entered the "real person" value correctly and the form has been rejected.</p> <?php } ?> </body> </html>
session_unset(); session_destroy(); header("Location: Login.php"); } ?> <?php if ($_POST) { function rpHash($value) { $hash = 5381; for ($i = 0; $i < strlen($value); $i++) { $hash = ($hash << 5) + $hash + ord(substr($value, $i)); } return $hash; } if (rpHash($_POST['captcha']) == $_POST['captchaHash']) { $dbhost = 'localhost'; $dbuser = '******'; $dbpass = ''; $dbname = 'cmt'; $flag = 0; $conn = mysqli_connect($dbhost, $dbuser, $dbpass, $dbname); $pass = $_POST['pass']; $id = $_POST['admin']; $sqll = "select id from admin"; $result_id = $conn->query($sqll); while ($row_id = mysqli_fetch_array($result_id)) { if ($row_id['id'] == $id) { $flag = 1; $sql = "select password from admin where id='{$id}'"; $passhash = crypt($pass, '$2a$' . $id);