Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Simple File URL Redirect

Code Wizard, 12-30-2006

This script makes it easy to redirect to anotehr page, anotehr site, or a file on the server. It appends it to two seperate files through two seperate variables.

<?php // ver 4.0 FINAL

//
// By : Andrew Heebner
//

if(isset($url)):
$fpl = fopen("url_log.txt","a");
$log = sprintf("%s | %s | %s | %s", date("d.M.Y H:i:s"), $HTTP_REFERER, $url, gethostbyaddr($REMOTE_ADDR));
fputs($fpl, "$log<br>
");
fclose($fpl);

$url = escapeshellcmd($url);
Header("Location: $url")

elseif(isset($fid)):
$fpf = fopen("file_log.txt","a");
$log = sprintf("%s | %s | %s", date("d.M.Y H:i:s"), basename($fid), gethostbyaddr($REMOTE_ADDR));
fputs($fpf, "$log<br>
");
fclose($fpf);

$fid = escapeshellcmd($fid);
Header("Location: $fid");

endif;

?>
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions