-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify-subscriber.php
executable file
·45 lines (41 loc) · 1.2 KB
/
verify-subscriber.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
require_once('header.php');
// Preventing the direct access of this page.
if ( !isset($_REQUEST['email']) || !isset($_REQUEST['key']) )
{
header('location: index.php');
exit;
}
else
{
// Check the data is valid or not.
$statement = $pdo->prepare("SELECT * FROM tbl_subscriber WHERE subs_email=? AND subs_hash=?");
$statement->execute(array($_REQUEST['email'],$_REQUEST['key']));
$total = $statement->rowCount();
if( $total == 0 )
{
header('location: index.php');
exit;
}
}
// Remove the hash and making the subscriber active by updating database
$statement = $pdo->prepare("UPDATE tbl_subscriber SET subs_hash=?, subs_active=? WHERE subs_email=?");
$statement->execute(array('',1,$_REQUEST['email']));
?>
<div class="page-banner" style="background-color:#444;">
<div class="inner">
<h1>Subscription Successful</h1>
</div>
</div>
<div class="page">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="user-content" style="color:green;">
Thank you for verifying your subscription.
</div>
</div>
</div>
</div>
</div>
<?php require_once('footer.php'); ?>