コード例 #1
0
} else {
    //	echo "<script> alert('3'); </script>";
    $stm = "select * from users where email='" . $email . "'";
    $res = mysqli_query($conn, $stm);
    if (mysqli_num_rows($res) > 0) {
        //		echo "<script> alert('4'); </script>";
        $_SESSION['errorMess'] = 2;
        echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/registerHere.php'>";
        //		echo "<script> alert('5'); </script>";
    } else {
        //		echo "<script> alert('6'); </script>";
        $value = 0;
        $cnumber = $cc . $cnumber;
        $stm = "insert into users(name, lname, email, username, password, contactNumber, activationCode,activated) values('" . $fname . "','" . $lname . "','" . $email . "','" . $uname . "','" . $password . "'," . $cnumber . "," . $activation . "," . $value . ");";
        mysqli_query($conn, $stm);
        //		echo "<script> alert('7'); </script>";
        $not = new notification();
        $link = "http://32.208.103.211/chatRegistration/activateAccount.php?activationCode=" . $activation . "&email=" . $email;
        $body = "Thank you for registering with us.<br><br><a href='" . $link . "'>Click here</a> to activate your account.";
        $ans = $not->email("*****@*****.**", "Administration", "*****@*****.**", "mailstodeliver", $email, "Activation Email", $body);
        $_SESSION['emailSent'] = $ans;
        echo "<script> alert('" . $ans . "'); </script>";
        if ($ans == 1) {
            $refCode = $not->message("12035432147", $cnumber, $link);
        }
        //		echo "<script> alert('8'); </script>";
        $_SESSION['newlyRegistered'] = $uname;
        echo "<meta http-equiv='refresh' content='0; url=http://32.208.103.211/chatRegistration/imageUpload.php'>";
    }
}
mysqli_close($conn);