Hi all,
I am writting a little script to make sure that users either have a session variable or cookie set in order to browse the website. Also, if one of them is set (ie: a cookie) but not the other (ie: the session), then make them match.
I am getting the following error:
Parse error: parse error, unexpected $ in /home/clinsave/public_html/includes/session_verify.php on line 41
However, line 41 is just the end of the code, and the lines before it look fine. What am I doing wrong?
<?php session_start(); ?>
<?php
// Session or cookie country code must exist
// If not, redirect
$statcount = 0;
$country_cookie = $COOKIE['country'];
$country_session = $SESSION['country'];
if (isset($country_cookie)) {
$statcount = $statcount +1;
}
if (isset($country_session)) {
$statcount = $statcount +1;
}
if ($statcount = 0) {
Header("Location:http://www.fantomdesign.com/~myclient/index.php");
?>
<?php
// Country cookie or session does exist
// If one of them is blank, populate it
if (!isset($country_cookie)) {
setcookie ("country", $country_session);
}
if (!isset($country_session)) {
$_SESSION['country'] = $country_cookie;
}
?>