Login
0) { $sql_query = "UPDATE jsLogin SET isActivated='1' WHERE email_address='$email_address' AND hash='$hash' AND isActivated='0'"; $result = mysqli_query($link, $sql_query); echo "
Congrats. Your account is activated.
Use the login form below.

"; } else { echo "
Invalid attempt.
Either your email address is already activated or the link is broken.

"; } } // register is clicked if(isset($_POST['register'])) { $link = mysqli_connect("tiephoon.com.mysql:3306", "tiephoon_com_tiephoon_customers", "TiEphoonFFM17", "tiephoon_com_tiephoon_customers"); $email_address = $_POST["js_register_emailaddress"]; $pwd = $_POST["js_register_pwd"]; $isActivated = 0; $hash = md5( rand(0,1000) ); //if user already exists $sql_query = "SELECT * FROM jsLogin WHERE email_address = '$email_address'"; mysqli_select_db($link,"tiephoon_com_tiephoon_customers"); $result = mysqli_query($link, $sql_query); if(mysqli_num_rows($result) > 0) { echo "
You are already a member.
Please use the login form below.

"; } else { $sql_query = "INSERT INTO jsLogin (email_address, pwd, hash, isActivated) VALUES ('$email_address', '$pwd', '$hash', '$isActivated')"; mysqli_select_db($link,"tiephoon_com_tiephoon_customers"); if(mysqli_query($link, $sql_query)) { echo "
Welcome to TiEphoon.
Please use the activation link sent to your email address.

"; $to = $email_address; // Send email to our user $subject = 'TiEphoon Signup | Verification'; // Give the email a subject $message = ' Thanks for signing up! Your account has been created, you can login with the following credentials after you have activated your account by pressing the url below. ------------------------ Username: '.$email_address.' Password: '.$pwd.' ------------------------ Please click this link to activate your account: http://www.tiephoon.com/jslogin.php?email_address='.$email_address.'&hash='.$hash.' '; // Our message above including the link $headers = 'From:info@tiephoon.com' . "\r\n"; // Set from headers mail($to, $subject, $message, $headers); // Send our email } } } //login is clicked if(isset($_POST['login'])) { $email_address = $_POST["js_emailaddress"]; $pwd = $_POST["js_pwd"]; $link = mysqli_connect("tiephoon.com.mysql:3306", "tiephoon_com_tiephoon_customers", "TiEphoonFFM17", "tiephoon_com_tiephoon_customers"); mysqli_select_db($link,"tiephoon_com_tiephoon_customers"); $sql_query = "SELECT * FROM jsLogin WHERE email_address = '$email_address'"; $result = mysqli_query($link, $sql_query); //if email address NOT registered if(mysqli_num_rows($result)==0) { echo "
You are not registered. Please register.

"; } //if email address registered else { $email_address = $_POST["js_emailaddress"]; $pwd = stripslashes($_POST["js_pwd"]); $sql_query = "SELECT * FROM jsLogin WHERE email_address = '$email_address' AND isActivated = 1"; $result = mysqli_query($link, $sql_query); //if email address is not activated if (mysqli_num_rows($result)==0) { echo "
You have not activated your account.
Please activate using the link sent to your email address.


"; } // if email address is activated else { $email_address = $_POST["js_emailaddress"]; $pwd = stripslashes($_POST["js_pwd"]); $sql_query = "SELECT * FROM jsLogin WHERE email_address = '$email_address' AND pwd = '$pwd'"; $result = mysqli_query($link, $sql_query); //if password is incorrect if (mysqli_num_rows($result)==0) { echo "
Incorrect email address or password.
Try again


"; } //if password is correct else { $_SESSION['username'] = $email_address; echo ""; exit(); } } } } ?>

TiEphoon Copyright @ All Rights Reserved | Terms of use