-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuserdetailinsert.php
More file actions
45 lines (38 loc) · 1.55 KB
/
userdetailinsert.php
File metadata and controls
45 lines (38 loc) · 1.55 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
<?php
session_start();
?>
<?php
if ($_POST['token'] == $_SESSION['token'])
{
$server="localhost";
$unm="root";
$pwd="";
$db="hotelmanagement";
$l=mysqli_connect($server,$unm,$pwd,$db);
//$l=mysqli_connect("localhost","root","root","hotel");
$userid=mysqli_real_escape_string($l,$_POST["username"]);
$password=mysqli_real_escape_string($l,$_POST['password']);
$username=mysqli_real_escape_string($l,$_POST['txtname']);
$useremail=mysqli_real_escape_string($l,$_POST['txtemail']);
$usercompany=mysqli_real_escape_string($l,$_POST['txtcompany']);
$userphone=mysqli_real_escape_string($l,$_POST['txtnumber']);
$useraddress=mysqli_real_escape_string($l,$_POST['txtaddress']);
$qiu=mysqli_query ($l,"INSERT INTO `user`
(`Userid`,`password`,`User Name`,`User Email`,`User Company`,`User Phone`,`User Address`)VALUES
('$userid',
'$password','$username','$useremail','$usercompany','$userphone','$useraddress');");
if(!$qiu)
{
$message = "Sorry! Username already taken :()";
echo "<script type='text/javascript'>alert('$message');</script>";
echo "<script>window.location='userinfo.php';</script>";
}
header("location:login.php?flag=1");
}
else
{
$message = "Sorry! Session Expired :()";
echo "<script type='text/javascript'>alert('$message');</script>";
echo "<script>window.location='userinfo.php';</script>";
}
?>