-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlabreg.php
More file actions
38 lines (35 loc) · 1.01 KB
/
Copy pathlabreg.php
File metadata and controls
38 lines (35 loc) · 1.01 KB
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
<?php
$mysql_hostname = "localhost";
$mysql_user = "root";
$mysql_password = "";
$mysql_database = "lab";
$prefix = "";
$bd = @mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database");
mysql_select_db($mysql_database, $bd) or die("Could not select database");
$prn=$_POST['prn'];
$fname=$_POST['fname'];
$class=$_POST['class'];
$date=date("Y-m-d");
date_default_timezone_set('Asia/kolkata');
$time=date("h:i:sa");
if($prn=="admin@123")
{
header("refresh:2;url=admin.php");
die();
}
$qry="INSERT INTO login(prn,fname,year,time,date) VALUES('$prn','$fname','$class','$time','$date')";
if(mysql_query($qry))
{
echo '<script language="javascript">';
echo 'alert("Entry registered successfully")';
echo '</script>';
header("refresh:2;url=http://192.168.1.8:8090");
}
else
{
echo '<script language="javascript">';
echo 'alert("Attempt failed try again")';
echo '</script>';
header("refresh:2;url:index.html");
}
?>