-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathserver.php
More file actions
38 lines (33 loc) · 862 Bytes
/
server.php
File metadata and controls
38 lines (33 loc) · 862 Bytes
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
28
29
30
31
32
33
34
35
36
37
38
<?php
$server_name="localhost";
$username="root";
$password="";
$database_name="project";
$conn=mysqli_connect($server_name,$username,$password,$database_name);
//now check the connection
if(!$conn)
{
die("Connection Failed:" . mysqli_connect_error());
}
if(isset($_POST['save']))
{
$first_name = $_POST['fname'];
$last_name = $_POST['lname'];
$dob = $_POST['dob'];
$email = $_POST['email'];
$password = $_POST['psw'];
$user_check ="Select * from user_details"
$sql_query = "INSERT INTO user_details (first_name,last_name,dob,email,password)
VALUES ('$first_name','$last_name','$dob','$email','$password')";
if (mysqli_query($conn, $sql_query))
{
sleep(2);
header('Location: login.html');
}
else
{
echo "Error: " . $sql . "" . mysqli_error($conn);
}
mysqli_close($conn);
}
?>