-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.php
More file actions
83 lines (63 loc) · 1.93 KB
/
signup.php
File metadata and controls
83 lines (63 loc) · 1.93 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
79
80
81
82
83
<?php
$con=mysqli_connect("localhost","root","","osdc");
if(isset($_post['submit']))
{
$name=$_POST["name"];
$email=$_POST["emailId"];
$mobno=$_POST["MobileNum"];
$password=$_POST["password"];
$cpassword=$_POST["confirmpassword"];
}
if(!$con)
{
echo"error";
die("failed".mysqli_connect_error());
}
else
{
$sql="INSERT INTO signup(name,email,mobno,password,cpassword)
values(name,email,mobno,password,cpassword)";
if(!mysqli_query($con,$sql))
{die("error".mysqli_error());
}
echo"record added";
}
?>
<!--
<?php
//require "includes/common.php";
$con=mysqli_connect("localhost","root","","osdc");
if (!$con) {
die("Connection failed: " . mysqli_connect_error());
}
session_start();
$email = $_POST['emailId'];
$email = mysqli_real_escape_string($con, $email);
$password = $_POST['password'];
$password = mysqli_real_escape_string($con, $password);
$password = md5($password);
$cpassword = $_POST['confirmpassword'];
$cpassword = mysqli_real_escape_string($con, $cpassword);
$cpassword = md5($cpassword);
$name = $_POST['name'];
$name = mysqli_real_escape_string($con, $name);
$mobno=$_POST['MobileNum'];
$mobno= mysqli_real_escape_string($con, $mobno);
//$last = $_POST['lastName'];
//$last = mysqli_real_escape_string($con, $last);
$query = "SELECT * from signup where email='$email'";
$result = mysqli_query($con, $query);
$num = mysqli_num_rows($result);
if ($num != 0) {
$m = "Email Already Exists";
header('location: index.php?error=' . $m);
} else {
$quer = "INSERT INTO signup(email,name,password,cpassword,mobno) values('$email','$name','$password','$cpassword','$mobno')";
mysqli_query($con, $quer);
/* echo "New record has id: " . mysqli_insert_id($con);
$user_id = mysqli_insert_id($con);
$_SESSION['email'] = $email;
$_SESSION['user_id'] = $user_id;*/
//header('location:products.php');
}
?>-->