Hello, I am trying to get this piece of code to redirect back to index.php if it’s called directly.
index.php:
[php]
Enter Download URL :
[/php]
remote.php:
[php]<?php
define(‘BUFSIZ’, 4095);
$url = $Link;
$dir = ‘./uploads/’;
$rfile = fopen($url, ‘r’);
$lfile = fopen($dir . basename($url), ‘w’);
while(!feof($rfile))
fwrite($lfile, fread($rfile, BUFSIZ), BUFSIZ);
fclose($rfile);
fclose($lfile);
echo ‘
File Remote Download Complete !
’;?>[/php]
Basically what I am trying to do is allow the script to call the remote.php but block and redirect direct access to the file such as going to http://www.mysite.com/remote.php.
Can someone show me the edited code to do this? Thanks in advance!