-
Notifications
You must be signed in to change notification settings - Fork 0
/
collegesuccess.php
47 lines (37 loc) · 1.35 KB
/
collegesuccess.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
<?php
/* if ($_POST["password"] == $_POST["confirm_password"]) {
success!
}
else {
$message='Password must match.';
echo " <script > alert('$message'); </script> ";
header("Location: cregister.php");
exit;
}*/
require 'connection.php';
$conn = Connect();
$collegename = $conn->real_escape_string($_POST['collegename']);
$email = $conn->real_escape_string($_POST['email']);
$address = $conn->real_escape_string($_POST['address']);
$eligible = $conn->real_escape_string($_POST['eligible']);
$courses = $conn->real_escape_string($_POST['courses']);
$contact = $conn->real_escape_string($_POST['contact']);
$rs=mysqli_query($conn,"select * from colleges where collegename='$collegename'");
if (mysqli_num_rows($rs))
{
echo "<br><br><br><div class=head1>Login Id Already Exists</div>";
exit;
}
$query = "INSERT into colleges (collegename,email,address,eligible,courses,contact) VALUES('" . $collegename. "', '" . $email. "', '" . $address . "', '" . $eligible . "', '" . $_POST["courses"] . "', '" . $_POST["contact"] . "')";
$success = $conn->query($query);
if (!$success) {
die("Couldn't enter data: ".$conn->error);
}
else
{
$message='You are successfully registred.';
echo " <script > alert('$message'); </script> ";
echo"<script>location.href = 'http://localhost/gsgproject/collegeregister.php';</script>";
}
$conn->close();
?>