Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_GET['page']) && $_GET['page']='activate' ) {
- unset($_SESSION['regok']);
- if (isset($_GET['hash'])) {
- $res = q("
- SELECT * FROM `no_active_users`
- WHERE `hash` = '".es($_GET['hash'])."'
- ");
- if (mysqli_num_rows($res)) {
- $row = mysqli_fetch_assoc($res);
- $res2 = q("
- SELECT * FROM `users`
- WHERE `name` = '".es($row['name'])."'
- LIMIT 1
- ");
- if (mysqli_num_rows($res2)) {
- $_SESSION['activated']='activated';
- }
- else {
- $result = q("
- SELECT MAX(`ID`) max_id FROM `users`
- ");
- if (mysqli_num_rows($result)) {
- $ID = mysqli_fetch_assoc($result);
- $ID['max_id'] = $ID['max_id'] + 16;
- }
- else {
- $ID['max_id'] = 32;
- }
- q("
- INSERT INTO `users` SET
- `name` = '".es($row['name'])."',
- `passwd` = '".es($row['passwd'])."',
- `email` = '".es($row['email'])."',
- `creatime` = '".es($row['creatime'])."',
- `ID` = '".$ID['max_id']."',
- `Prompt` = '0',
- `answer` = '0',
- `truename` = '0',
- `idnumber` = '0',
- `mobilenumber` = '0',
- `province` = '0',
- `phonenumber` = '0',
- `city` = '0',
- `address` = '0',
- `postalcode` = '0'
- ");
- q("
- UPDATE `no_active_users` SET
- `hash` = 'none'
- WHERE `name` = '".es($row['name'])."'
- ");
- $_SESSION['activating'] ='activating';
- $_SESSION['name'] = $row['name'];
- $_SESSION['ID'] = $ID['max_id'];
- }
- } else {
- $_SESSION['activatefall'] = 'activatefall';
- }
- }
- ?>
- </div>
- </body>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement