Jump to content

filter requests by domain


smile

Recommended Posts

hello, I have this php script on" domain22.com" that processes the requests:

 

mysa_output.php

<?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;
}
?>
 

Then I have code that I put on some other domain33.com that connects to this script to pull data

<?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'); ?> 

My problem is that I need to filter and allow the domain33.com and "&show_ad=2" so that from domain33.com you can't view others ID ads like "&show_ad=5" "&show_ad=10" etc.

 

There would be multiple domains, and ID's. Simple cycle check would work fine.

 

I need to put some code into the mysa_output.php

Thank you.

Edited by cyberRobot
fixed [code][/code] tag
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.