-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathuserinsert.php
More file actions
78 lines (64 loc) · 1.98 KB
/
Copy pathuserinsert.php
File metadata and controls
78 lines (64 loc) · 1.98 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
$Name=$_POST['Name'];
$Email=$_POST['Email'];
$Birthday=$_POST['Birthday'];
$Pwd=$_POST['Pwd'];
$CPwd=$_POST['CPwd'];
$Gender=$_POST['Gender'];
$Nominee=$_POST['Nominee'];
$Branch=$_POST['Branch'];
$Mobile=$_POST['Mobile'];
if($Name && $Email && $Birthday && $Pwd && $CPwd && $Gender && $Nominee && $Branch && $Mobile)
{
if(preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $Email))
{
if(strlen($Pwd)>7)
{
if($Pwd==$CPwd)
{
mysql_connect("localhost", "root", "") or die("we couldn't connect");
mysql_select_db("userdetail");
$username=mysql_query("SELECT Name FROM user WHERE Name='$Name'");
$count=mysql_num_rows($username);
$checknum=mysql_query("SELECT Mobile FROM user WHERE Mobile='$Mobile'");
$numsecurity=mysql_num_rows($checknum);
$checkemail=mysql_query("SELECT Email FROM user WHERE Email='$Email'");
$emailsecurity=mysql_num_rows($checkemail);
if($count!=0)
{
die("<b><center><h1>Error...</b>Name already exits!! Try another name</h1>");
}
if($emailsecurity!=0)
{
die("<b><center>Email already exits!! Enter new email id</b>");
}
if($numsecurity!=0)
{
die("<b><center><h2>Mobile number already registered!!please enter new number</b></h2>");
}
//$Pwdmd5=md5($Pwd);
mysql_query("INSERT INTO user(Name,Email,Birthday,Pwd,CPwd,Gender,Nominee,Branch,Mobile) VALUES('$Name','$Email','$Birthday','$Pwd','$CPwd','$Gender','$Nominee','$Branch','$Mobile')");
echo "<b><h3><center> Succcessfully registered!!</h3></b>";
//header("location:user.php");
//header("location:fetching.php");
}
else
{
echo "<b><center><h4>Password & Confirm Password</b> did not match...<h4>";
}
}
else
{
echo "<center><h5><b>Password </b>is too short!! It must lies between 8 and 15 character</h5>";
}
}
else
{
echo "<b><center>Please Enter valid Email !!!</b>";
}
}
else
{
echo "<b><h6><center>All fields are mandatory...</h6></b>";
}
?>