-
Notifications
You must be signed in to change notification settings - Fork 0
/
User_signup.php
39 lines (31 loc) · 1 KB
/
User_signup.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
<?php
// Set connection variables
$server = "localhost";
$username = "root";
$password = "";
$db="hbs";
// Create a database connection
$con = mysqli_connect($server, $username, $password,$db);
// Check for connection success
if(!$con){
die("connection to this database failed due to" . mysqli_connect_error());
}
$name = $_POST['name'];
$pass = $_POST['pass'];
$email = $_POST['email'];
// $mobile = $_POST['mobile'];
// $address = $_POST['address'];
// $city = $_POST['city'];
// $state = $_POST['state'];
// $pin = $_POST['pin'];
$sql="INSERT INTO user (user_pass ,user_name ,email,is_admin ) VALUES ('$pass', '$name','$email',0);";
$con->query($sql);
$last_id = $con->insert_id;
$msg='Success id = '.$last_id;
$con->close();
$loc="index.html";
echo "<script type='text/javascript'>
alert('$msg');
window.location.href='$loc';
</script>";
?>