Location: PHPKode > scripts > WH Social > wh_social/verify.php
<?php require('framework/session.php'); ?>
<?php require('style/layout/header.php'); ?>

<div id="content_wrapper">
    <div class="content">

    <?php

		if(isset($_GET['email']) && !empty($_GET['email']) AND isset($_GET['hash']) && !empty($_GET['hash'])) {

		$email = htmlentities($_GET['email']);
		$hash = htmlentities($_GET['hash']);

		$getid = "SELECT id, email, hash FROM members WHERE email = '" . mysql_escape_string($email) . "' LIMIT 1";
		$check = mysql_query($getid) OR die(mysql_error());

		while($row = mysql_fetch_assoc($check)) {

    		$id = (int)$row['id'];
    		$uh = mysql_real_escape_string($row['hash']);

		if($_SERVER['REQUEST_METHOD'] != 'POST') {

        echo '<table align="center" width="350" border="0" cellpadding="0" cellspacing="0" summary="' . $lang['signin'] . '">
        <tr><td><h1>' . $lang['account_activation'] . '</h1>
        <p>' . $lang['activate_your_account'] . '</p></td></tr>
        <tr><td><div class="sign_in">
        <form method="post" action="">
        <p><input type="text" class="textfields" name="email" value="' . $email . '" size="50"> ' . $lang['e_mail_adress'] . '</p>
        <p><input type="text" class="textfields" name="hash" value="' . $hash . '" size="50"> ' . $lang['hash_code'] . '</p>
        <input type="hidden" name="id" value=' . $id . '>
        <p><input type="submit" class="buttons" value="' . $lang['activate'] . '" alt="' . $lang['activate'] . '"></p>
        </form></div></td></tr></table>';

		}else{

		$errors = array();

		if(isset($_POST['email'])) {
		if(trim($_POST['email']) == "") {
		$errors[] = $lang['email_must_be_filled'];
		}

			}else{
			$errors[] = $lang['email_is_not_valid'];
			}

		if(isset($_POST['hash'])) {
		if(trim($_POST['hash']) == "") {
		$errors[] = $lang['hash_must_be_filled'];
		}

		if($_POST['hash'] != $uh) {
		$errors[] = $lang['hash_is_not_valid'];
		}

			}else{
			$errors[] = $lang['invalid_hash_syntax'];
			}

		if(!empty($errors)) {

		echo '<p class="false">' . $lang['not_filled_in_all_fields'] . ' - <a href="javascript:history.back();" class="false_link">' . $lang['back'] . '</a></p>';
		echo '<ul>';

		foreach($errors as $key => $value) {
		echo '<li>&#8226; ' . $value . '</li>';
		}
		echo '</ul>';

			}else{

			$sql = "UPDATE
						members
					SET
						active = '1'
					WHERE
						id = '" . $id . "'";

			mysql_query($sql) OR die(mysql_error());

		if(mysql_affected_rows() == 1) {

		echo '<p class="success">' . $lang['account_successfully_activated'] . ' - <a href="signin.php" class="success_link">' . $lang['go_to_signin'] . '</a></p>';

			}else{

			echo '<p class="false">' . $lang['activation_not_completed'] . ' - <a href="javascript:history.back();" class="false_link">' . $lang['back'] . '</a></p>';
            }

        }}}

        }else{

        echo '<p class="false">' . $lang['click_the_activation_link'] . '</p>';
        }

	?>

<?php require('style/layout/footer.php'); ?>
Return current item: WH Social