Jump to content

PHP Redirect After Page loads


magcshroom

Recommended Posts

Ok, so basically i am using this existing code to redirect to a different page. I send traffic from adwords to www.mydomain.com/site1.php, which forwards to www.mydomain.com/page/. The referrer of the next page www.google.com shows www.mydomain.com/page/. If i were to do a header redirect, it would show www.mydomain.com/site1.php as the referrer, which is no good. So, my problem lies with the script not redirecting fast enough. My page loads, and then it redirects, but it is very slow. I don't want them to see the page if possible, but it still needs to pass on the referrer.

 

<?php

$site1 = "http://www.mydomain.com/site1.php";
$affiliate_link = "http://www.mydomain.com/page/";

if($_SERVER['HTTP_REFERER'] == $site1)
{
echo "<body onload=\"javascript:frmClickTracking.submit();\">";
echo "<form action=\"" . $affiliate_link . "\" method=\"post\" name=\"frmClickTracking\">";
echo "</form>";
}

?>

Link to comment
https://forums.phpfreaks.com/topic/151587-php-redirect-after-page-loads/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.