-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreg.php
More file actions
54 lines (37 loc) · 1.11 KB
/
Copy pathreg.php
File metadata and controls
54 lines (37 loc) · 1.11 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
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>
<body>
<?php
$mysqli = new MySQLi('localhost','root','','webproject');
if($mysqli->connect_error)
{
die("Database not connected " . $mysqli->connect_error);
}
$u_name = $_POST['U_name'];
$Email = $_POST['email'];
$passw = $_POST['pass'];
$type = $_POST['u_type'];
$phNumber = $_POST['phNo'];
if(empty($u_name) || empty($Email) || empty($passw) || empty($type) || empty($phNumber))
{
echo("Please fill all the details");
}
else
{
//echo("Working");
//if(isset($_POST['submit']))
//$enc = md5($passw);
$sql = "INSERT into users(userType,Name,email,Phone_No,password) VALUES('{$mysqli->real_escape_string($type)}','{$mysqli->real_escape_string($u_name)}','{$mysqli->real_escape_string($Email)}','{$mysqli->real_escape_string($phNumber)}','{$mysqli->real_escape_string($passw)}') ";
$insert = $mysqli->query($sql);
if($insert)
echo("User registered");
else
echo("Error");
}
?>
</body>
</html>