Mercurial > hg > ywww
view user/uk/confirmation.php @ 49:a67bf725e87b
put both paths in include_path and depend on that
author | Charlie Root |
---|---|
date | Wed, 16 Jan 2019 13:42:15 -0500 |
parents | 077b0a0a3e6d |
children |
line wrap: on
line source
<?PHP include "db.php"; // Passkey that got from link $passkey=$_GET['passkey']; $tbl_name1="temp_user"; $loc = 1; // Retrieve data from table where row that match this passkey $sql1="SELECT * FROM $tbl_name1 WHERE confirm_code ='$passkey'"; //echo $sql1; $result1=mysqli_query($link,$sql1); // If successfully queried if($result1){ // Count how many row has this passkey $count=mysqli_num_rows($result1); //echo $count; // if found this passkey in our database, retrieve data from table if($count==1){ $rows=mysqli_fetch_array($result1, MYSQLI_ASSOC); $email=$rows['Email']; $password=$rows['Password']; $fname=$rows['FirstName']; $sname=$rows['Surname']; $tbl_name2="user"; // Insert data that retrieves from "temp_members_db" into table "registered_members" //$add = 'insert into user values (null,\'' . $email . '\',\'' . $password . '\');'; $add="CALL addNewUser('$email', '$password', '$fname', '$sname', $loc)"; //echo $add; $result2 = mysqli_query($link, $add); } // if not found passkey, display message else { echo "Invalid Confirmation code"; } // if successfully moved data from table"temp_members_db" to table "registered_members" displays message "Your account has been activated" and don't forget to delete confirmation code from table "temp_members_db" if($result2){ //Would prefer to create the cookie here, but GWT doesn't seem able to read it /*session_start(); $_SESSION['email']=$email; //session_id(); $DURATION = 1209600000;//(1000 * 60 * 60 * 24 * 14); //Cookies.setCookie("bookWhacksid", sessionID, expires, null, "/", false); setcookie("bookWhacksid", session_id(), time()+$DURATION);*/ //echo "Thank you, your account has been activated\nwww.bookwhack.co.uk"; $redirectURL = "redirect.html"; header("Location:$redirectURL"); // Delete information of this user from table "temp_members_db" that has this passkey $sql3="DELETE FROM $tbl_name1 WHERE confirm_code = '$passkey'"; $result3=mysqli_query($link,$sql3); } } ?>