-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsignup.php
More file actions
63 lines (51 loc) · 1.32 KB
/
signup.php
File metadata and controls
63 lines (51 loc) · 1.32 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
55
56
57
58
59
60
61
62
63
<?php
if(isset($_POST['submit']))
{
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "letstudy";
$port="3306";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname,$port);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
//mysql_select_db("user", $conn);
#echo "Connected successfully";
$Name=$Branch=$Username=$Password=$Contact=$Email="";
if(isset($_POST["Name"])){
$Name = $_POST["Name"];
}
echo "$Name";
//$Name = $_POST["Name"];
// $Name = $_POST["Name"];
//$Branch = $_POST["Branch"];
if(isset($_POST["Branch"])){
$Branch = $_POST["Branch"];
}
if(isset($_POST["Username"])){
$Username = $_POST["Username"];
}
//$Username = $_POST["Username"];
//$Password = $_POST["Password"];
if(isset($_POST["Password"])){
$Password = $_POST["Password"];
}
//$Contact = $_POST["Contact"];
if(isset($_POST["Contact"])){
$Contact = $_POST["Contact"];
}
//$Email = $_POST["Email"];
if(isset($_POST["Email"])){
$Email = $_POST["Email"];
}
$sql = "INSERT INTO user VALUES ('$Name','$Branch','$Username','$Password','$Contact','$Email')";
if ($conn->query($sql) === TRUE) {
echo "Sign in successful!";
} else {
echo "Error: " . $conn->error;
}
}
?>