Location: PHPKode > projects > Spam free PHP GuestBook > Spam free PHP GuestBook-1.2beta/gb/verify.php
header('Content-Type: text/html; charset=ISO-8859-1');
header("Cache-Control: no-cache, must-revalidate");
include "include/functions.php";
include "include/connection.php";
class clsverify extends connection
private function verify_email()
        @mysql_query("DELETE FROM ".$this->prefix."tmpuser WHERE date < $lastdate");
        @mysql_query("DELETE FROM ".$this->prefix."user WHERE level = 7 AND date < $lastdate");
        @mysql_query("UPDATE ".$this->prefix."user set level = 6 WHERE level = 8 AND date < $lastdate");
        if(!fw_validate_email($email)){return false;}
        $query=sprintf("SELECT id, uid, verify FROM ".$this->prefix."tmpuser WHERE email = '%s'",mysql_real_escape_string($email));
        if(@mysql_num_rows($result)!==1){return false;}
        $row = @mysql_fetch_array($result, MYSQL_ASSOC);
        if(md5($row['verify'])!==$confirm){return false;}
        $query=sprintf("UPDATE ".$this->prefix."user set level = 6 WHERE email = '%s'",mysql_real_escape_string($email));
		if(!empty($row['uid'])){$query=sprintf("UPDATE ".$this->prefix."user set level = 6 WHERE id = %d",$row['uid']);}
        if(mysql_affected_rows()<>1){return false;}
        $query=sprintf("DELETE FROM ".$this->prefix."tmpuser WHERE email = '%s'",mysql_real_escape_string($email));
        return true;
public function verify()
<title><?php echo ($b? 'Confirmed user' : 'Invalid request');?></title>
h1 { font-family: Tahoma; font-size: 14pt; color: #333333; padding-bottom:2px; text-align:center; }
ul { list-style-type: square;text-align:left;margin:0;padding:5px 15px; }
p { line-height: 100%; margin-top: 0; margin-bottom: 5px; padding:0; }
<div style="margin: 100px; padding: 0; width: 520px; text-align: left;">
if($b){echo '
<h1>Confirmed user</h1>
<p>Your email address has been confirmed. Please follow the link to login your control panel.</p>
<p style="text-align:center;"><a href="http://'.getenv('HTTP_HOST').fw_get_docroot().'gb/user/index.php">Login</a> | <a href="http://'.getenv('HTTP_HOST').fw_get_docroot().'index.php">Index</a></p>
else{echo '
<h1>Invalid request!</h1>
<p>This url does not exist! <a href="http://'.getenv('HTTP_HOST').fw_get_docroot().'index.php">Click here</a> to go back to Index page. Probable reasons may be</p>
<li>You have typed wrong url</li>
<li>Your session has been expired</li>
$cls=new clsverify('');
Return current item: Spam free PHP GuestBook