If need be, I can explain this further, but would anyone know why I cannot use a login script to another cookie/database in an EE template. I’ve got PHP enabled, and I’ve tried it on both settings—Input vs Output, but EE just seems to ignore the script. Here’s what I place at the top of my template:
if (!isset($_COOKIE[‘webinsider’]))
{
Header(“Location: http://www.XYZ.com/us/registration/registration.php”);
}
else
{
$Email = $HTTP_COOKIE_VARS[‘webinsider’];
// Establish connection
echo $varEmail;
include(”../../Connections/webdb.php”);
// Verify Login is correct
mysql_select_db($database_webdb, $webdb);
$query_rsLogin = “SELECT * FROM users WHERE users.varEmail = ‘$Email’”;
$rsLogin = mysql_query($query_rsLogin, $webdb) or die(mysql_error());
$row_rsLogin = mysql_fetch_assoc($rsLogin);
$totalRows_rsLogin = mysql_num_rows($rsLogin);
// If no Login, delete cookie and redirect to Access Denied message
if($totalRows_rsLogin==0){
setCookie(“webinsider”,”“,time()-86400,”/”);
setcookie (“webinsider”, “”, time() - 3600);
Header(“Location: http://www.XYZ.com/us/registration/accessdenied.php”);
mysql_free_result($rsLogin);
} else {
mysql_free_result($rsLogin);
}
}
