-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction_page.php
27 lines (27 loc) · 999 Bytes
/
action_page.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
<?php
$db = mysqli_connect('localhost','root','','Student');
$usn = $_POST['USN'];
$pass = $_POST['psw'];
$pass1 =$_POST['psw-repeat'];
$email = $_POST['email'];
$phone = $_POST['phone'];
if (!filter_var($email, FILTER_VALIDATE_EMAIL))
{
echo '<script> alert("Invalid email");</script>';
}
if($pass1!=$pass)
{
echo '<script> alert("Passwords do not match");</script>';
}
if(strlen((string)$phone)<10)
{
echo '<script> alert("Invalid phone number");</script>';
}
$query = "INSERT INTO LOGIN (USN,password,EMAIL,PHONE) VALUES ('$usn','$pass','$email','$phone')";
if(mysqli_query($db,$query))
{
echo "<h1 style='color:#fefefe;text-align:center;'><br><br><br><br><br><br>Sign-up Successfull</h1><br>";
echo "<a style='color:#fefefe;' href='login.html'><h3 style='text-align:center;'>Click here to login</h3></a>";
echo "<body background='https://wallpapershome.com/images/pages/pic_h/17860.jpg' >";
}
?>