-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsignup.php
More file actions
38 lines (32 loc) · 861 Bytes
/
signup.php
File metadata and controls
38 lines (32 loc) · 861 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
<html>
<head></head>
<body background="images/background.jpg"></body>
</html>
<?php
include("database.php");
$firstname = $_POST['firstname'];
$email = $_POST['email'];
$password = $_POST['password'];
/*echo $firstname;
echo $email;
echo $password;*/
$sql = mysqli_query($con,"select * from userdetails where email='$email'");
if(mysqli_num_rows($sql)>0)
{
echo "<center><h2>User already exists</h2></center>";
}
else
{
$insert = mysqli_query($con,"insert into userdetails (firstname,email,password) values ('$firstname','$email','$password')");
if($insert)
{
echo "<center><h2>You have been successfully Registered</h2></center>";
//echo "<center><h4><a href='index.php'>Click here</a> to Login</h4></center>";
include ("signout.php");
}
else
{
echo "Not registered";
}
}
?>