<?
include "header.php";
if(isset($_GET['u'])) { $u_id = $_GET['u']; } else { exit(); }
if(isset($_GET['c'])) { $code = $_GET['c']; } else { exit(); }
if(mysql_num_rows(mysql_query("SELECT u_id FROM bhost_users WHERE u_id='$u_id' AND code='$code'")) == 0) { exit(); }

mysql_query("UPDATE bhost_users SET verified='1' WHERE u_id='$u_id' AND code='$code'");
$user_info = mysql_fetch_assoc(mysql_query("SELECT fname, lname, username, email FROM bhost_users WHERE u_id='$u_id'"));
$weblog_info = mysql_fetch_assoc(mysql_query("SELECT w_id, weblog FROM bhost_weblogs WHERE u_id='$u_id' ORDER BY w_id LIMIT 1"));

echo $head;

echo "
<h2>$verify1</h2>
$verify2
<br><br>
<form action='login.php' method='POST'>
<input type='submit' class='button' value='$verify3'>
</form>
";

echo $foot;

?>