Forum Moderators: coopster
<?php
$mkid = $_GET['MKID'];
if(isset($mkid)){
session_start();
$_SESSION['MKID'] = $mkid;
}
session_start();
if(!isset($_SESSION['MKID']))
$_SESSION['MKID'] = 0;
?>
My goal here is to get the variable "MKID" from an incoming url and stick that variable into a session for future use (on any page of my site). If an incoming link doesn't have an MKID value, I just want to set it to zero. The current code throws a bunch of PHP errors at me ("Cannot send session cookie - headers already sent").
Thanks.