forked from prakharsingh1312/Helloworld
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin_verify.php
More file actions
26 lines (24 loc) · 776 Bytes
/
admin_verify.php
File metadata and controls
26 lines (24 loc) · 776 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
<?php
session_start();
function alert($msg) {
echo "<script type='text/javascript'>alert('$msg');</script>";
}
include("Assets/php/dbconfig.php");
if(isset($_SESSION['email']))
header("location:redirect.php");
$email=mysqli_real_escape_string($dbconfig,$_GET['email']);
$hash=mysqli_real_escape_string($dbconfig,$_GET['hash']);
$query=$dbconfig->prepare("SELECT * from admin_login WHERE email=? AND hash=?");
$query->bind_param("ss",$email,$hash);
$query->execute();
$query=$query->get_result();
$count=$query->num_rows;
if($count==1)
{
$query=$dbconfig->prepare("UPDATE admin_login SET activated=1 WHERE hash=? AND email=?");
$query->bind_param("ss",$hash,$email);
$query->execute();
$query=$query->get_result();
$_SESSION['acti']=1;
header("location:admin.php");
}