-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.php
More file actions
18 lines (17 loc) · 741 Bytes
/
signup.php
File metadata and controls
18 lines (17 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
require "Database.php";
$db = new Database(); //Dynamically create a Database object
if (isset($_POST['firstname']) && isset($_POST['surname']) && isset($_POST['email']) && isset($_POST['username']) && isset($_POST['password'])) {
if ($db->dbconnect()) { //First check if the connection to the database has been established
if ($db->signUp("users", $_POST['firstname'], $_POST['surname'], $_POST['email'], $_POST['username'], $_POST['password'])) {
echo "Sign Up is Successful"; //Message to display if the user signup is successful
} else {
echo "Sign Up Failed";
}
} else {
echo "Error: Database connection";
}
} else {
echo "All fields are required";
}
?>