undertsanding redirect code ?? not possible is it?

halifax123

Power Member
Joined
Aug 5, 2008
Messages
594
Reaction score
66
hey fellow roomates, :rain:

I'm trying to get my mind around a script
it's for a redirector code ...my only "similar" experience, was using
a double meta refresh once prior about a yr ago, with that code I made
my link point to a "php 2" folder that pointed to "php 1" then to
the main index
if I recall correctly that is

but the code I pasted below doesn't come with enough explanation
and I'm not tech minded enough to deduce the proper
implementation of the code and put it into use


does it use a separate "php" script? or do I just
incorporate part of the script into the index?

and if it is a simple incorporation, if I had as an example 4
directory folders on my site(4 pages) what might I place on the individual
code of each one? (as you can see I'm stumped!)

(I'm confused and would greatly appreciate any
direction or suggestion.....)(I am the "appendix" of tech! :help:)

PHP:
<?php
 
//Standalone CPA Redirector v2

//Settings

$magic_number = 1234; // Any number you choose except ZERO!

$cpa_offer_url = 'http://www.google.com';


//Don't edit below this line unless you know what you are doing.

if (isset($_GET['mn']) && $_GET['mn']==$magic_number){		

		echo '<html><head></head><body><form action="' . 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] . '" method="post" id="form1">

<input type="hidden"  name="mn" value="' . $magic_number . '" /></form>

<script language="JavaScript"> 
	document.getElementById(\'form1\').submit();</script></body></html>';
		return true; 
		exit();
}

if ($_POST['mn']==$magic_number){		

	echo '<html><head></head><body><form action="' . 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'] . '" method="post" id="form1">

<input type="hidden"  name="mn" value="' . $magic_number . $magic_number . '" /></form>

<script language="JavaScript"> 
	document.getElementById(\'form1\').submit();</script></body></html>';
		return true; 
		exit();
}	

$dom = preg_replace( "/^www\./", "", $_SERVER[ 'HTTP_HOST' ] ) ;
$ref= $_SERVER['HTTP_REFERER'];


if (((strpos($ref, $dom)!=FALSE) || (trim($ref)=="" ) )  && ($_POST['mn']==$magic_number.$magic_number)){
		header( 'Location: ' . $cpa_offer_url);
		exit();
	}

?>

<html>
  <head>
    <title>Your supposed Landing Page</title>
  </head>
  <body>
	<br><br><br><br>
	 <center><h1>Your supposed Landing Page</h1></center>
 
  </body>
</html>

I did use a wordpress version that I was able to successfully get to work
but it was a plugin that had simple easy to follow directions
but bviously this is a different animal altogether

thank you very much for considering with any post or assistance

Hali~!:) ......... :becky:
:stupid:
 
how to employ it?

where does it go? do I include everything shown? or
remove anything? maybe an example would help?

if I were to have
a site with folder/directory

mysite.cum/pager ...

using that example, if it would be possible
to explain or rather show me how I would
set it up, I would certainly learn from that
that might be the easiest way I would imagine

thanks for trying to assist deziner
it might be simple for someone like you
but for me it's "greek"

code is pretty simple, what dont you understand ?
 
Last edited:
set your magic number (lets say its 1234)
and set your cpa offer url

place the php code above your whitehat site's source code (lets say it's called whitehat.php)

then direct your blackhat traffic to whitehat.php?mn=1234
that'll fake the referer to your whitehat site and redirect them to the offer url

any AMs checking your whitehat site wouldn't know your magic number, so they'd just go to whitehat.php, which displays as normal without redirecting
 
thanks apocolypse,

(I'll try to ask a few things)

so then the code only goes on the index page?
so I paste the "code in it's entirety on the index page?


the "numerical" appointment(magic #) I for the most part understand
so I can "button the coat" if you will

I just don't know how to "put the coat together" and "arrange the pieces"


so then the entire code is simply added to the index.html page?
if that's accurate between what and where is the code placed?

do I need to create a separate "php" page ???

(the example I was trying to give assumes I have two
files at this point, an "index.html" and a folder named "pager"
so that's my "orientation with reality" at the moment, I don't
come from a coding, progamming, or technical background, I
come from a "stupid" background)


so I don't have the background in this area of "logic" that
would allow me to extrapolate, or deduce what might
be obvious to some

imagine there is someone who is known as the "dumbest person on earth"
now imagine you are communicating with that person..
 
Last edited:
you just place it above everything, on your index page only.

it actually says that in the code you posted, but for some reason the bottom part which includes the landing page code is in black text so no one can see it.. lol wtf?

alternatively you can just place the php section of the code (without the sample landing page code) into its own php file and then include it on your index page using the php include function, which would do exact same thing.
 
I think you probably "get it" now, but if not send me a PM and I'll help you out, this is very easy to set up if you know what you're doing.
 
Back
Top