From 5fd9fa480f302902328b81f912dd67ce378284f8 Mon Sep 17 00:00:00 2001 From: citizenz7 Date: Thu, 20 Apr 2017 18:50:55 +0200 Subject: V.1.4.6 --- Html/activate.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 Html/activate.php (limited to 'Html/activate.php') diff --git a/Html/activate.php b/Html/activate.php new file mode 100644 index 0000000..777f640 --- /dev/null +++ b/Html/activate.php @@ -0,0 +1,40 @@ +prepare("UPDATE blog_members SET active = 'yes' WHERE memberID = :memberID AND active = :active"); + $stmt->execute(array( + ':memberID' => $memberID, + ':active' => $active + )); + + //if the row was updated redirect the user + if($stmt->rowCount() == 1){ + + $stmt = $db->prepare("SELECT username FROM blog_members WHERE memberID = :memberID"); + $stmt->execute(array( + ':memberID' => $memberID, + )); + $row = $stmt->fetch(); + + $username = $row['username']; + + //redirect to login page + write_log('Nouveau membre : '.$username, $db); + header('Location: '.SITEURL.'/admin/login.php?action=active'); + exit; + + } else { + header('Location: '.SITEURL.'/admin/login.php?action=echec'); + exit; + } + +} +?> -- cgit v1.2.1