-
Notifications
You must be signed in to change notification settings - Fork 0
/
register.php
executable file
·50 lines (48 loc) · 1.16 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
<?php
/**
* @author
* @copyright 2017
*/
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$dbname = "DBthon";
$dberror = "Unable to Connect";
$conn = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname) or die ($dberror);
//$link = mysqli_connect("localhost", "root", "", "demo");
if($conn == true)
{
echo "CONNECTED TO THE CENTRAL DATABASE";
}
$user = $_POST['uid2'];
$name = $_POST['nam2'];
$pass = $_POST['pass2'];
$address = $_POST['address2'];
$ph = $_POST['ph2'];
$dsg = $_POST['dsg2'];
$spc = $_POST['spc2'];
$cbno = $_POST['cb2'];
$altr = $_POST['alt2'];
echo "$user";
echo "$name";
echo "$pass";
echo "$dsg";
echo "$cbno";
$query = "INSERT INTO faculty VALUES ('$user','$name','$pass','$dsg',$cbno)";
$executed = mysqli_query($conn,$query);
$per = "insert into contact_fac VALUES ('$user','$ph')";
$result = mysqli_query($conn,$per);
$query = "insert into contact_fac VALUES ('$user','$altr')";
$executed = mysqli_query($conn,$query);
if(!$executed)
{
echo "<br><hr><h1 align=\"center\">ERROR DURING REGISTRATION</h1><hr>";
}
else
{?>
<script>
alert("Welcome to our VIT Family");
</script>
<?php
}
?>