/* Creating session */ $_SESSION["username"] = $_POST["username"]; $_SESSION["pswd"] = $_POST["pswd"]; $username = trim($_SESSION["username"]); $password = trim($_SESSION["pswd"]); /* if (isset($_POST['remember'])) { $value = 'something from somewhere'; setcookie("TestCookie", $value); echo $_COOKIE["TestCookie"]; } */ /* $sql = "SELECT emailaddress,password, firstname, lastname from accounts where emailaddress='$username'"; $result=mysql_query( $sql, $connect); $row = mysql_fetch_row($result); */ $row = $obj->usernamefetchrow($username); $flagcaptcha = 0; if ($tempvalue == $_POST["captcha"]) { $flagcaptcha = 9; $_SESSION['my_captcha'] = $tempvalue; } $flag = 1; if ($row[0]) { $flag = 10; } if ($flag > 3 && $flagcaptcha > 3) { if ($row[1] == md5($password) && $row[0] == $username) { $_SESSION["fname"] = $row[2]; $_SESSION["lname"] = $row[3]; if (isset($_POST['remember'])) { $cookie_name = "cookieusername";
if (isset($_SESSION["username"]) and !isset($_POST["emailforget"])) { $mailvalue = $_SESSION["username"]; } else { if (isset($_POST["emailforget"])) { $mailvalue = $_POST["emailforget"]; $_SESSION["username"] = $_POST["emailforget"]; } else { $mailvalue = ""; } } $mailvalue = $_POST["emailforget"]; $_SESSION["username"] = $_POST["emailforget"]; /* $sql = "SELECT emailaddress from accounts where emailaddress='$mailvalue'"; $result=mysql_query( $sql, $connect); $row = mysql_fetch_row($result); */ $row = $obj->usernamefetchrow($mailvalue); $flag = 1; if ($row[0]) { $flag = 10; } if ($flag > 3) { header('Location: hint1.php'); } else { ?> <div> <label> <?php echo "*Username not found. Seems like you haven't registered!!!!"; ?> </label> </div>
$valuefalg = 1; } else { if (!preg_match('`[0-9]`', $password)) { $valuefalg = 1; } else { if (!preg_match('`[@#$%]`', $password)) { $valuefalg = 1; } } } } } /* $sql = "SELECT emailaddress,password from accounts where emailaddress='$value1'"; $result=mysql_query( $sql, $connect); $row = mysql_fetch_row($result); */ $row = $obj->usernamefetchrow($value1); $flag = 1; if ($row[0]) { $flag = 10; } if ($value4 == $value5 && $flag < 5 && $value1 == $valuemail && $valuefalg > 5) { $value44 = md5($value4); /* $sql = "INSERT INTO accounts (emailaddress, firstname , lastname , password , Hint , hintAnswer) VALUES ('$value1','$value2','$value3','$value44','$value6','$value7')"; if (mysql_query( $sql, $connect )===true ) */ $result = $obj->sqlConnect($value1, $value2, $value3, $value44, $value6, $value7); if ($result === true) { //echo "attendees values inserted successfully<br>"; header('Location: print.php'); } else {