-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
42 lines (40 loc) · 917 Bytes
/
Copy pathinsert.php
File metadata and controls
42 lines (40 loc) · 917 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
39
40
41
42
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head><title>MDBMS</title></head>
<body>
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$x1=$_POST["fname"];
$x2=$_POST["lname"];
$x3=$_POST["emailid"];
$x4=$_POST["password"];
mysql_select_db("Movie", $con);
$i=1;
$flag=0;
$result5 = mysql_query("SELECT * FROM `User`");
while($row = mysql_fetch_array($result5))
{
$mail[$i]=$row["Emailid"];
$i=$i+1;}
for($r=1;$r<$i;$r++)
{ if($mail[$r]==$x3)
{$flag=$flag+1;}
}
if($flag==0)
{ mysql_query("INSERT INTO User (Firstname, Lastname, Emailid, Password)
VALUES
('$x1','$x2','$x3','$x4')");
echo "Successfully registered at MDBMS";}
else if($flag!=0)
{ header("Location:badreg.php");}
mysql_close($con);
?>
<br/>
<br/>
<a href="home.php">SIGN IN</a>
</body>
</html>