Forum Moderators: coopster
<?php
$mysa_ipaddress = strip_tags($_GET['r']);
if(strip_tags(urldecode($_GET['h']))!='') $mysa_hostname = strip_tags(urldecode($_GET['h']));
if(strip_tags(urldecode($_GET['rf']))!='') $mysa_referer = strip_tags(urldecode($_GET['rf']));
$mysa_show_ad_group = strip_tags($_GET['show_ad_group']);
$mysa_show_ad = strip_tags($_GET['show_ad']);
if (is_numeric($mysa_show_ad_group)){
include_once("mysimpleads.php");show_ad_group($mysa_show_ad_group);
} else if (is_numeric($mysa_show_ad)){
include_once("mysimpleads.php");show_ad($mysa_show_ad);
} else {
exit;
}
?> <?php @readfile('http://domain22.com/mysa_output.php?r='.$_SERVER['REMOTE_ADDR'].'&h='.urlencode($_SERVER['HTTP_HOST']).'&rf='.urlencode($_SERVER['HTTP_REFERER']).'&show_ad=2'); ?> <?php
$yoursite = "yoursite.com"; //Your site url without http://
$yoursite2 = "www.yoursite.com"; //Type your domain with www. this time
$referer = $_SERVER['HTTP_REFERER'];
//Check if browser sends referrer url or not
if ($referer == "") { //If not, set referrer as your domain
$domain = $yoursite;
} else {
$domain = parse_url($referer); //If yes, parse referrer
}
if($domain['host'] == $yoursite || $domain['host'] == $yoursite2) {
//Run your image generation code
} else {
//The referrer is not your site, we redirect to your home page
header("Location: http://yoursite.com");
exit(); //Stop running the script
}
?> <?php
//get pg referer if there is one
if (isset($_SERVER['HTTP_REFERER'])) {
$ref_url = $_SERVER['HTTP_REFERER']; //get referrer
}else{
$ref_url = 'No referrer set'; // show failure message
}//end else no referer set
echo "<h3>Refferring URL: $ref_url</h3>";
?> [edited by: phranque at 4:00 am (utc) on Sep 1, 2017]
[edit reason] no specifics, please. see forum Charter [/edit]
$current_page = ( isset ( $_SERVER [ 'HTTPS' ] ) ? 'https' : 'http' ) . '://' . $_SERVER [ 'HTTP_HOST' ] . $_SERVER [ 'REQUEST_URI' ] ;
$opts = array (
'http' => array (
'header' => array ( 'Referer: ' . $current_page . "\r\n" )
)
) ;
$context = stream_context_create ( $opts ) ;
readfile( <url> , false , $context ) ;