-
Notifications
You must be signed in to change notification settings - Fork 1
/
register.php
52 lines (41 loc) · 1.53 KB
/
register.php
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
<?php
error_reporting(0);
session_start();
$db = mysqli_connect("localhost", "root", "", "myshopdb");
if (isset($_POST['registerbtn']))
{
$username = mysqli_real_escape_string($db, $_POST['username']);
$email = mysqli_real_escape_string($db, $_POST['email']);
$mobile = mysqli_real_escape_string($db, $_POST['mobile']);
$gender = mysqli_real_escape_string($db, $_POST['gender']);
$state = mysqli_real_escape_string($db, $_POST['state']);
$password = mysqli_real_escape_string($db, $_POST['password']);
$password2 = mysqli_real_escape_string($db, $_POST['password2']);
if ($password == $password2)
{
$password2 = md5($password);
$sql = "INSERT INTO logininfo(uname, emailadd, mobileno, gender, location, pass, hashpass) VALUES('$username', '$email', '$mobile', '$gender', '$state', '$password', '$password2')";
mysqli_query($db, $sql);
include 'flogin.php';
}
else
{
include 'fregister.php';
}
}
?>
<script>
alert("<?php
$username = mysqli_real_escape_string($db, $_POST['username']);
$password = mysqli_real_escape_string($db, $_POST['password']);
$password2 = mysqli_real_escape_string($db, $_POST['password2']);
if ($password == $password2)
{
echo "$username, You Have Successfully registered!";
}
else
{
echo "$username, Your's Registration Failed! Passwords do not Match";
}
?>");
</script>