Hello

Here is a simple script that allows to automaticly redirect a domain name like www.example.com to any other url if people type www.example.com?mn=1234

It works like a charm but Id like to improve this script like this:

Instead of the function of redirection , it will display an Iframe.

In other term , when people go to www.example.com , people sees the normal website. When people enter www.example.com?mn=1234 , a simple Iframe displays on the webpage ( Classic Iframe format : <iframe></iframe> )

If anyone can help me , thanks

PHP Code:
<?php

//Standalone script

//Settings

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

$link '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();
}


?>