How to redirect a visitor to another website with log management?
When you need a PHP redirecting script with Log management . So Here i have written a Script in PHP Language Redirect to another Address with Log management .When you need to redirect a visitor from your site to another URL its come handy to have a full log of user.
Here is a Script available that will log your user’s information & then Redirect them to desired URL .
You can use Either $_GET Method or $_POST Method , but using $_GET method is more clear & responsive.
Jus put these codes & save as PHP
//you will be redirect to $url by GET method ;
//* Script Written by http://www.cstweaks.com/ */
$userip = $_SERVER[“REMOTE_ADDR”];
$logtime = date(“d/m/y H:i:s”);
$dt = new DateTime();
$handle = fopen(“redirectlogs.txt”, “a”);
foreach($_GET as $variable)
fwrite($handle, “## “);
fwrite($handle, $dt->format(‘Y-m-d H:i:s’));
Echo “You will be Redirect to “;
<a href=”<?echo $url?>“>click Here</a>
Let Save this As “go.php” in your website directory & files location will become
Now you can pass it web address with parameter “url” by GET method . Now your address will become.
Live demo of PHP web Redirect Script with LogManagement
Your Logs will be saved On same directory with file name – redirectlogs.txt
Have Any Query / Trouble ? Feel free to comment below.