forked from himanshukumar9/CHATBOX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathregistration.php
More file actions
66 lines (63 loc) · 2.99 KB
/
registration.php
File metadata and controls
66 lines (63 loc) · 2.99 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
<?php
include("configuration.php");
$name=$_POST['name'];
$nname=$_POST['nname'];
$email=$_POST['email'];
$contact=$_POST['contact'];
$dob=$_POST['dob'];
$p1=$_POST['p1'];
$p2=$_POST['p2'];
$date=date('d-M-Y');
$c=mysqli_query($al,"SELECT * FROM users WHERE email='$email'");
if($name==NULL || $nname==NULL || $email==NULL || $contact==NULL || $p1==NULL || $p2==NULL || $dob==NULL)
{
}
elseif(mysqli_num_rows($c)==1)
{
$info="Email ID or Nick Name Already Exists";
}
elseif($p1==$p2)
{
$p3=sha1($p1);
$sql=mysqli_query($al,"INSERT INTO users(name,nick,dob,email,contact,password,date) VALUES('$name','$nname','$dob','$email','$contact','$p3','$date')");
if($sql) {
$info="Successfully Registered User $name";
} else { $info = "Error in Registration"; }
}
else
{
$info="Password Didn't Matched";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registration Panel</title>
<link href="scripts/styleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div align="center">
<span class="heading">User Registration Panel</span><br />
<br />
<br />
<br />
<form method="post" action="">
<table class="table" cellpadding="4" cellspacing="4">
<tr><td colspan="2" align="center" class="text">All Fields are Mandatory</td></tr>
<tr><td colspan="2" align="center" class="info"><?php echo $info;?></td></tr>
<tr><td class="labels">Full Name : </td><td><input type="text" name="name" size="40" class="fields" placeholder="Enter Full Name" required="required" /></td></tr>
<tr><td class="labels">Nick Name : </td><td><input type="text" name="nname" size="40" class="fields" placeholder="Enter Nick Name" required="required" /></td></tr>
<tr><td class="labels">Date of Birth : </td><td><input type="text" name="dob" size="20" class="fields" placeholder="DD/MM/YYYY" maxlength="10" required="required" /></td></tr>
<tr><td class="labels">Email ID : </td><td><input type="email" name="email" size="40" class="fields" placeholder="Enter Email ID" required="required" /></td></tr>
<tr><td class="labels">Contact No. : </td><td><input type="text" name="contact" size="30" class="fields" placeholder="Enter Contact No." maxlength="10" required="required" /></td></tr>
<tr><td class="labels">Password : </td><td><input type="password" name="p1" size="40" class="fields" placeholder="Enter Password" required="required" /></td></tr>
<tr><td class="labels">Re-Type Password : </td><td><input type="password" name="p2" size="40" class="fields" placeholder="Re-Type Password" required="required" /></td></tr>
<tr><td colspan="2" align="center"><input type="submit" value="Register Me" class="commandButton" onclick="return confirm('Please check everything before submitting');" /></td></tr>
</table>
</form>
<br />
<a href="index.php">BACK</a>
</div>
</body>
</html>