-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
34 lines (33 loc) · 772 Bytes
/
insert.php
File metadata and controls
34 lines (33 loc) · 772 Bytes
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
<?php
session_start();
if(!isset($_SESSION['us1'])) // If session is not set then redirect to Login Page
{
header("Location:index.php");
}
else {
$now = time();
if ($now > $_SESSION['expire']) {
session_destroy();
}
}
$name=$_GET['name'];
$email=$_GET['email'];
$password=$_GET['password'];
$con=mysqli_connect("localhost","root","","cc");
if(!$con)
{
die("Connection failed".mysqli_connect_error());
}
$sql1="insert into user(name,email,password) values('$name','$email','$password')";
$result1 = mysqli_query($con,$sql1);
if($result1)
{
echo "<script>alert('Get Ready To Code');</script>";
header("Location:index.php");
}
else
{
echo "Oops! something went wrong!".mysqli_error($con);
}
mysqli_close($con);
?>