Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'config.php';
- // Grab token from the URL
- $token = $_GET['token'];
- // Search token in database and show informations of the user
- $searchToken = $db->prepare('
- SELECT * FROM users
- WHERE token = :token
- ');
- $searchToken->execute([
- 'token' => $token
- ]);
- $items = $searchToken->rowCount() ? $searchToken : [];
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Document</title>
- </head>
- <body>
- <?php if(!empty($token)): ?>
- <?php if(!$searchToken->rowCount() == 0): ?>
- <?php foreach($items as $item): ?>
- <p><b>First name: </b><?=$item['first_name']?></p>
- <p><b>Last name: </b><?=$item['last_name']?></p>
- <p><b>E-Mail: </b><?=$item['email']?></p>
- <?php endforeach; ?>
- <?php else: ?>
- <p>That user does not exist!</p>
- <?php endif; ?>
- <?php else: ?>
- <p>Please fill token URL!</p>
- <?php endif; ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement