-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgettingdata.php
More file actions
37 lines (36 loc) · 868 Bytes
/
gettingdata.php
File metadata and controls
37 lines (36 loc) · 868 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
35
36
37
<?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'];
$description=$_GET['Description'];
$level=$_GET['Level'];
$input=$_GET['input'];
$output=$_GET['input'];
$con=mysqli_connect("localhost","root","","cc");
if(!$con)
{
die("Connection failed".mysqli_connect_error());
}
$random = rand(1000,9999);
$sql1="insert into question values($random,'$name','$description','$level','$input','$output')";
$result1 = mysqli_query($con,$sql1);
if($result1)
{
echo "<script>alert('Get Ready To Code');</script>";
header("Location:admin.php");
}
else
{
echo "Oops! something went wrong!".mysqli_error($con);
}
mysqli_close($con);
?>