You get a bonus - 1 coin for daily activity.
Now you have 1 coin
MS IE 8 does not pass the referrer $_SERVER['HTTP_REFERER'] PHP
Practice
MS IE 8 does not pass the referrer $_SERVER['HTTP_REFERER']
PHP
I wanted to use session variables to store dates, changed via the URL,
but for some reason in IE8 the value $_SERVER['HTTP_REFERER'] is empty
how do I get this value
here's the code
$URL=$_SERVER['HTTP_REFERER'];alas, but IE8 does not pass the referrer via javascript
if (checkdate(2, 29, $user_year))$max_day[2]=29; else $max_day[2]=28; // what year do we have here anyway? =)
// let's check whether it's a leap year in PHP
$query =' SELECT min( YEAR (`news_date`)) as minyear FROM `module_news`;
$row = $db->GetRow($query);
if ($row) $minyear = $row['minyear']; else $minyear= date("Y");
$year_arr = array ();
/* date("Y")-2 will be replaced by the min news year via a db query*/
for($i= date("Y");$i>$minyear-1;$i--)
{
$year_arr[$i] = $i;
}
if (($user_day=='')and ($user_month!= date("m") ) and ($user_year!= date("Y") )) { $user_day = 0 ;}//
// select for day
if ($thisnews==1) {$strainer1.= "
a universal way to determine the referrer for IE8 donkeys
Add this at the beginning of the code
// get the full URL of the current page
function current_page_url(){
$page_url = 'http';
if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on'){
$page_url .= 's';
}
return $page_url.'://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
}
// if the session has started
if(isset($_SESSION['referrer'])){
// get the existing referrer
$referrer = $_SESSION['referrer'];
} elseif(isset($_SERVER['HTTP_REFERER'])){
// use the obtained referrer
$referrer = $_SERVER['HTTP_REFERER'];
} else {
// no referrer
}
$URL=$referrer ;// $_SERVER['HTTP_REFERER'];alas, but IE8 does not pass the referrer via javascript
// save the current page as the referrer for the next one
$_SESSION['referrer'] = current_page_url();
and these are the conditions for selecting news for today, yesterday, and for a specific day, depending on the values of the session filter variables in php
if ( ($_SESSION['show_top_day']==0)) // any
{
}
if (($_SESSION['show_top_day']==-2)) // TODAY
{
$query1 .= " AND (DAY( news_date ) = DAY( CURDATE()) ) ";
$query2 .= " AND (DAY( news_date ) = DAY( CURDATE()) ) ";
$stainer_date.=" AND (DAY( news_date ) = DAY( CURDATE()) ) ";
Comments