-
Notifications
You must be signed in to change notification settings - Fork 0
/
activate.php
41 lines (34 loc) · 1.05 KB
/
activate.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
<?php
require_once "lib/app.php";
try {
$db = open_db($db_address_abs);
$stmt = $db->prepare("SELECT * FROM {$tableName} WHERE accessKey = :akey");
if ($stmt->execute( [ ':akey'=>$_GET['akey'] ])) {
while ($row = $stmt->fetch()) {
$data = $row;
$id = $data['id'];
}
}
if ($data) {
$stmt = $db->prepare("UPDATE {$tableName} SET lastAccessDate = :lac WHERE id = :id");
$lac = $now->format($datetime_db_fstr);
$res = $stmt->execute( [':lac'=>$lac, ':id'=>$id ]);
//var_dump($res);
}
// Close file db connection
// -------------------------------------------------------------------------
$db = null;
}
catch(PDOException $e) {
// Print PDOException message
echo $e->getMessage();
echo '<br />';
var_dump($e->getTraceAsString());
}
?>
<h1>Registration ID <?=$id?> activated</h1>
<p>
<?=$data['title']?> <?=$data['firstname']?> <?=$data['lastname']?> <br>
price: <?=$data['price']?> <br>
has payed: <?=B($data['hasPayed'])?> <br>
</p>