-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfirmMail.php
More file actions
24 lines (21 loc) · 970 Bytes
/
Copy pathconfirmMail.php
File metadata and controls
24 lines (21 loc) · 970 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
<?php
require_once "config/config.php";
if(isset($_GET['token']) && isset($_GET['userid'])){
$token = $_GET['token'];
$userId = $_GET['userid'];
$buscar_user = $con->prepare("SELECT * FROM users WHERE id = :user_id AND registertoken = :token LIMIT 1");
$buscar_user->bindParam(':user_id', $userId, PDO::PARAM_STR);
$buscar_user->bindParam(':token', $token, PDO::PARAM_STR);
$buscar_user->execute();
if($buscar_user->rowCount() == 1){
$buscar_user = $con->prepare("UPDATE users SET registertoken = '' WHERE users.id = :user_id");
$buscar_user->bindParam(':user_id', $userId, PDO::PARAM_STR);
$buscar_user->execute();
$buscar_user = $con->prepare("UPDATE users SET rank = 1 WHERE users.id = :user_id");
$buscar_user->bindParam(':user_id', $userId, PDO::PARAM_STR);
$buscar_user->execute();
echo "Usuario confirmado! Regresa a la pagina para iniciar sesion.";
} else{
echo "Token invalido.";
}
}?>