forked from kenmochii/event_wp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
60 lines (42 loc) · 1.17 KB
/
Copy pathprocess.php
File metadata and controls
60 lines (42 loc) · 1.17 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<!DOCTYPE html>
<html>
<head></head>
<body>
<?php
$con = mysqli_connect('localhost','root','','eventwp');
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
$email=$_POST["email"];
$password=$_POST["password"];
$fname=$_POST["first_name"];
$lname=$_POST["last_name"];
$gender=$_POST["gender"];
$phone=$_POST["phone"];
//$ticket=$_POST["ticket"];
$query = "SELECT * FROM user WHERE email='$email' ";
$sql_result = mysqli_query($con , $query);
if (mysqli_num_rows($sql_result)>0) //to return the query result in number of rows
{
header("refresh:4.0; url=register.html");
die("Email account is already exist. Please try to register again.");
}
else
{
$sql=" INSERT INTO user VALUES('$email', '$password', '$fname', '$lname', 'User', '$phone', '$gender', NULL) ";
$result =mysqli_query($con,$sql) or die("Error in inserting data due to ".mysql_error());
if($result)
{
echo "You have successfully registered in Tomorrowland!";
mysqli_close($con);
header("refresh:4.0; url=signin.html");
}
else
{
echo "Error in registration new user. Please try to register again.";
header("refresh:4.0; url=register.html");
}
}
?>
</body>
</html>