I'm trying to write some php code to set a cookie for traffic being reffered from a search engine. I'm a PHP novice and when I try to implement the following code I keep getting syntax errors. Do you guys (and gals) see any obvious problems with the code?
<?php
$ref = $_SERVER['HTTP_REFERER'];
$SE = array('/search?', 'images.google.', 'web.info.com', 'search.', 'del.icio.us/search', 'soso.com', '/search/', '.yahoo.');
foreach ($SE as $source) {
if (strpos($ref,$source)!==false) {
setcookie("sevisitor", 1, time()+3600, "/", ".scooter-news.com");
$sevisitor=true;
}
}
?>
thanks!
cookie php code help?
Moderator: General Moderators
Re: cookie php code help?
the error i keep getting it:
Parse error: syntax error, unexpected T_VARIABLE in /home/rcarden/public_html/templates/rt_mixxmag_j15/index.php on line 73
Parse error: syntax error, unexpected T_VARIABLE in /home/rcarden/public_html/templates/rt_mixxmag_j15/index.php on line 73