-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.php
43 lines (37 loc) · 1 KB
/
signup.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
<?php
if(isset($_POST["college_id"]) & isset($_POST["name"]) & isset($_POST["email"]) & isset($_POST["password"])) //make it more precise
{
require "connection.php";
$college_id = $_POST["college_id"];
$name = htmlspecialchars($_POST["name"], ENT_QUOTES, UTF-8);
//$name = $_POST["name"];
$email = $_POST["email"];
$password = $_POST["password"];
$query="INSERT INTO student(college_id,name,email,password) VALUES ($college_id,'$name','$email','$password')";
$run = mysqli_query($connection,$query);
if($run)
{
?>
<form id="success" action="index.php" method="post">
<input type="hidden" name="success" value="success">
</form>
<script type="text/javascript">
document.getElementById('success').submit();
</script>
<?php
}
else {
?>
<form id="error" action="index.php" method="post">
<input type="hidden" name="error" value="error">
</form>
<script type="text/javascript">
document.getElementById('error').submit();
</script>
<?php
}
}
else {
header("Location : index.php");
}
?>