Forum Moderators: coopster
Another thing, this is running on a secure (SSL) server, does that make a difference?
<?php
setcookie('aff_ses', session_start());
setcookie('aff_id', $_GET['aff_id']);
setcookie('aff_ip', $_SERVER['REMOTE_ADDR']);
setcookie('aff_ref', $_SERVER['HTTP_REFERER']);
setcookie('longtime', 'nextyear', time() + (60 * 60 * 24 * 365));
$nextYear = time() + (60 * 60 * 24 * 365);
setcookie('visittime', time(), $nextYear);
$referer = preg_replace("/(http:\/\/(.*)\/)[\S]*/", "\\1", $_SERVER['HTTP_REFERER']);
$name = preg_replace("/http:\/\//", "", $referer);
require("config2.php");
$query = "SELECT * FROM affiliates_session WHERE aff_ses = '".session_id()."' AND aff_id ='". $_COOKIE['aff_id']."'";
$q = mysql_query($query);
$numrows = mysql_num_rows($q);
if($numrows == 0){
$sql = "INSERT INTO affiliates_session(aff_ses, aff_id, aff_ip, aff_ref, aff_bas) VALUES(
'".session_id()."',
'".$_COOKIE['aff_id']."',
'".$_COOKIE['aff_ip']."',
'".$_COOKIE['aff_ref']."',
'".$name."');";
mysql_query($sql)
or die("Sorry, there was a problem adding new sponsor<br /> ".mysql_error());
//$comment = "Info has been inserted<br />";
}
else {
//$comment = "No info inserted<br />";
}
require("testVals.php");
$current = date("Y-m-d");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN""http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- Start Meta Data -->
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>My Wesbite Title</title>
<meta name="description" content="<?=$desc1;?>" />
<meta name="keywords" content="<?=$keywords;?>" />
<META name="robots" content="index,follow">
<link href="https://secure.example.com/main.css" rel="stylesheet" type="text/css" />
Thanks in advance
[edited by: dreamcatcher at 6:22 am (utc) on July 23, 2009]
[edit reason] Removed specifics. [/edit]