<? session_start();
setcookie(curl, $_SERVER['REQUEST_URI'], time()+3600, '/');
$valid_user = $_SESSION['valid_user'];
$user = $_SESSION['user'];
$u = $_GET['u'];
$v = $_GET['v'];
if (session_is_registered("valid_user")) { header("location: index.php"); exit; }
include("connect.php");
$result = mysql_query("UPDATE login SET verify = 'verified' WHERE userid = '$u' AND verify = '$v'");
if (($user) || (mysql_affected_rows==1))
{
$update=true;
if ($user)
{
$valid_user = $user;
session_unregister("user");
}
else
$valid_user = $u;
session_register("valid_user");
}
include("header.php");
$nav_title="Open Account";
include("navbar.php");
include("tab3.php");
?>
<div class="content">
<?
if ($update==true)
{
?>
<h1>Congratulations</h1>
<p>Your email address was verified sucessfully. You can now bid, buy and sell.</p>
<p>What would you like to do now?</p>
<ul>
<li><a class="co" href="buy.php"><b>Browse our categories</b></a></li>
<li><a class="co" href="sell.php"><b>Sell something</b></a></li>
<li><a class="co" href="my_auction.php"><b>View your account details</b></a></li>
</ul>
<?
}
else
{
?>
<h1>There is a problem</h1>
<?
$result = mysql_query("SELECT * FROM login WHERE userid='$u' AND verify='verified'");
if (mysql_num_rows($result)>0)
{
echo "<p>The email address for <b>$u</b> has already been verified.</p>";
echo "<ul><li><a class=\"co\" href=\"sign_in.php\"><b>Sign in to access your account</b></a></li></ul>";
}
else
{
?>
<p>We could not verify your email address.</p>
<p>The reason for this might be:</p>
<ol>
<li>The email address has already been verified.</li>
<li>The verification number is incorrect.</li>
</ol>
<p>If you cannot click the link in the email we sent, please ensure it is copied and pasted correctly in your web browser.</p>
<?
}
}
?>
<table height="1" cellpadding="0" cellspacing="0" width="100%"><tr></tr></table>
</div>
<? include("footer.php"); ?>