Compare commits
3 Commits
162b347119
...
65920bc0ac
Author | SHA1 | Date |
---|---|---|
mrlan | 65920bc0ac | |
Lan Hui | e66af1f419 | |
Lan Hui | fc8ad0c0a9 |
|
@ -494,6 +494,10 @@ include 'Header.php';
|
||||||
echo '<hr><span class="alert alert-success" role="alert">' . $_SESSION['info_Courses_student'] . '</span>';
|
echo '<hr><span class="alert alert-success" role="alert">' . $_SESSION['info_Courses_student'] . '</span>';
|
||||||
$_SESSION['info_Courses_student'] = null;
|
$_SESSION['info_Courses_student'] = null;
|
||||||
}
|
}
|
||||||
|
if (isset($_SESSION['info_signup'])) {
|
||||||
|
echo '<hr><div class="alert alert-danger" role="alert">' . $_SESSION['info_signup'] . '</div>';
|
||||||
|
$_SESSION['info_signup'] = null;
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<br><br>
|
<br><br>
|
||||||
</div>
|
</div>
|
||||||
|
|
13
Script.php
13
Script.php
|
@ -70,10 +70,7 @@ if (!empty($_POST["form_signup"])) {
|
||||||
// check if email is taken
|
// check if email is taken
|
||||||
$result = mysqli_query($con, "SELECT * FROM users_table WHERE email='$email'");
|
$result = mysqli_query($con, "SELECT * FROM users_table WHERE email='$email'");
|
||||||
if (mysqli_num_rows($result) != 0) {
|
if (mysqli_num_rows($result) != 0) {
|
||||||
$_SESSION["info_signup"] = "Email address " . $email . " is already in use.";
|
$_SESSION["info_signup"] = "Email address " . $email . " is already in use. You have already signed up?";
|
||||||
$_SESSION['user_fullname'] = null;
|
|
||||||
header("Location: signup.php");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_SESSION['user_fullname'] = $_POST["fullname"];
|
$_SESSION['user_fullname'] = $_POST["fullname"];
|
||||||
|
@ -161,11 +158,9 @@ if (!empty($_POST["form_signup"])) {
|
||||||
|
|
||||||
// check if email is taken
|
// check if email is taken
|
||||||
$result = mysqli_query($con, "SELECT * FROM users_table WHERE email='$email'");
|
$result = mysqli_query($con, "SELECT * FROM users_table WHERE email='$email'");
|
||||||
if (mysqli_num_rows($result) != 0) {
|
if(mysqli_num_rows($result) != 0)
|
||||||
$_SESSION["info_signup"] = "Email address " . $email . " is already in use.";
|
{
|
||||||
$_SESSION['user_fullname'] = null;
|
$_SESSION["info_signup"]="Email address ".$email." is already in use. Do you have an old LRR account?";
|
||||||
header("Location: signup.php");
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue