1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- require_once('php/db_utils.php');
- if(isset($_GET['salt'])) {
- $salt = $_GET['salt'];
- $conn = db_connect();
-
- if(!($result = mysqli_query($conn, "SELECT * FROM user WHERE salt = '$salt'"))) {
- $verification = 'false';
- }
- else {
- if(mysqli_num_rows($result) != 1) {
- $verification = 'false';
- }
- else {
-
- if(!mysqli_query($conn, "UPDATE user SET activated = TRUE WHERE salt = '$salt'")) {
- $verification = 'false';
- }
- else {
- $verification = 'true';
- }
- }
- }
- mysqli_free_result($result);
- db_close($conn);
- }
- else {
- $verification = 'false';
- }
- header('Location: /index.html?verification='. $verification);
- ?>
|