-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate-faculty.php
39 lines (36 loc) · 1.27 KB
/
validate-faculty.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
//variables of faculty user entries
$username = $_POST["user-name"];
$firstname = $_POST["first-name"];
$middlename = $_POST["middle-name"];
$lastname = $_POST["last-name"];
$mail = $_POST["e-mail"];
$password = $_POST["pass-word"];
$cpassword = $_POST["confirm-password"];
$phone = $_POST["phone-number"];
$courses = $_POST["courses"];
//entering into table "faculty" the entered data
if($firstname==''|| $midlename==''|| $lastname==''|| $mail==''|| $phone==''|| $username==''|| $courses==''|| $password==''|| $cpassword==''){
include('faculty-signup.php');
echo "<h4>Starred Enteries are Mandatory</h4>";
}
else if($password != $cpassword){
include('faculty-signup.php');
echo "<h4>Your Passwords didn't match</h4>";
}else{
$servername = "localhost";
$server_username = "root";
$server_password = "";
$dbname = "ping";
// Create connection
$conn = new mysqli($servername, $server_username, $server_password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
if(mysqli_query("INSERT INTO faculty VALUES('$rn','$fn','$ln','$email','$p','$programme','$branch','$pn')")){
include('login.php');
echo "<center><h3>Now you can Login</h3></center>";
}
}
?>