-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.php
More file actions
27 lines (21 loc) · 1.03 KB
/
signup.php
File metadata and controls
27 lines (21 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
include 'dbh.php';
$correctInfo = isset($_POST["sid"]) && !empty($_POST["sid"]) && isset($_POST["FirstName"]) && !empty($_POST["FirstName"])
&& isset($_POST["LastName"]) && !empty($_POST["LastName"]) && isset($_POST["Phone"]) && !empty($_POST["Phone"]);
if ($correctInfo) {
$sid = mysqli_real_escape_string($conn, $_POST["sid"]);
$FirstName = mysqli_real_escape_string($conn, $_POST["FirstName "]);
$LastName = mysqli_real_escape_string($conn, $_POST["LastName"]);
$Phone = mysqli_real_escape_string($conn, $_POST["Phone"]);
$sql = "INSERT INTO Student VALUES ('$sid', '$FirstName ', '$LastName', '$Phone');";
mysqli_query($conn, $sql);
echo "<br>";
echo "sign up success, please go back an log in with your new account";
} else {
echo "<br>";
echo "invalid information";
}
?>
<link href="./css/signup.css" type="text/css" rel="stylesheet">
<br>
<input type="button" value="Back" class="button" id="backbtnstudent" onClick="document.location.href='studentSignIn.php'">