confirmation page
Posted: Tue Oct 30, 2007 5:11 am
This is the code written for confirming members through email.
If there is any improvements that has to be made in the above code, please let me know.
Thanks
Code: Select all
<?php
require_once('general/require_once.php');
$confirm_code=$_GET['cc'];
if(!empty($confirm_code))
{
$query_check=mysql_query("SELECT * FROM members WHERE confirm_code='$confirm_code' AND confirm_flag='YES'");
if(mysql_num_rows($query_check) == 1)
{
$fetch_det=mysql_fetch_array($query_check);
$member_id=$fetch_det['member_id'];
session_start();
$_SESSION['member_id']=$member_id;
header("Location: ".SITE_URL);
}
elseif(mysql_num_rows(mysql_query("SELECT * FROM members WHERE confirm_code='$confirm_code' AND confirm_flag !='YES'"))==1)
{
$date=GetDateTime();
$query_update_confirm=mysql_query("UPDATE members SET confirm_flag='YES', confirmation_date='$date' WHERE confirm_code='$confirm_code'");
if($query_update_confirm)
{
$query_det=mysql_query("SELECT * FROM members WHERE confirm_code='$confirm_code' AND confirm_flag='YES'");
if(mysql_num_rows($query_det)==1)
{
$fetch_det=mysql_fetch_array($query_det);
$member_id=$fetch_det['member_id'];
session_start();
$_SESSION['member_id']=$member_id;
header("Location: ".SITE_URL);
}
}
}
else
echo 'Invalid confirmation';
}
?>Thanks