Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Update database table row if a qualifying token is provided

$token = $_GET['token'] ?? null;
if ($token) {
    require('../private/autoload.php');              
    $sql = "UPDATE users
            SET email_status='active'
            WHERE email_status='inactive'
              AND email_token=? LIMIT 1";
    $stmt = $conn->prepare($sql);
    $stmt->bind_param("s", $token);
    $stmt->execute();
    if ($stmt->affected_rows) {
        $_SESSION['msg'] = "Email verified successfully, Thank you.";
        $_SESSION['token'] = $token; // why store this in the session?
        header('Location: mobile_verify.php');
        exit();
    }
}
// missing or invalid submission
header('Location: index.php');
exit();
Comment

PREVIOUS NEXT
Code Example
Php :: import csv in laravel 
Php :: how to select and deselect all items without use name in laravel 
Php :: get woocommerce customers object 
Php :: mail php send 
Php :: Random select value on array factory Laravel 
Php :: Drupal sync directory in settings.php 
Php :: pass guzzle client data to view laravel 
Php :: voirs les cles etrangeres phpmyadmin 
Php :: Laravel retrieving aggregates 
Php :: wordpress get_permalink not working 
Php :: woo show Cross-Sells 
Php :: t variable error meaning in php 
Php :: how to disable auto prediction html input in laravel 
Php :: PHP strcspn — Find length of initial segment not matching mask 
Php :: get auth guard user laravel 
Php :: run multiple php scripts parallel 
Php :: Laravel 9 Multiple File Upload 
Php :: codeigniter query Profiling - To enable the profiler 
Php :: php loop through array shorthand 
Php :: php phalcon 
Php :: Two ways of assigning anonymous class to a variable 
Php :: wp plugin handles deregister 
Php :: powerpack add custom image size 
Php :: how to search locations in php using ajax google script 
Php :: laravel pdf generator 
Php :: current date time in php for input 
Php :: assign multiple variables php 
Php :: how to get the url parameter in blade laravel 
Php :: loop through object php 
Php :: print select mysql in php 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =