forked from isishan/hacktoberfest
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathreg.php
More file actions
39 lines (32 loc) · 787 Bytes
/
reg.php
File metadata and controls
39 lines (32 loc) · 787 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
<?php
if (isset($_POST['submit'])) {
$name= $_POST['name'];
$email= $_POST['email'];
$mobile= $_POST['mobile'];
$pass=$_POST['pass'];
$repass=$_POST['repass'];
$security=$_POST['security'];
if ($pass != $repass) {
echo "password not match";
}
if ($security != '56789') {
echo "security code wrong";
}
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "rtosystem";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error)
{
die("connection failed: ".$conn->connect_error);
}
echo "connect successfully";
$sql="INSERT INTO registration (name, email, mobile, pass) VALUES ('$name','$email','$mobile','$pass')";
if($conn->query($sql)===TRUE)
{
echo"data inserted";
header('Refresh: 2; URL=login.html');
}
}
?>