Originally posted by Kudose
try adding your absolute path to the fopen command.
like:
$dir = "/home/username/public_html/";
$file = "file.txt";
$path = $dir.$file;
fopen($path, "w");
[/B]
I should have explained it better.... I am grabbing a remote file with the full url (it also has a querystring). Example:
$cat_url = 'http://www.somesite/somefolder/file.php?linebreak=;&delim=,&list_delim=|&sort_by=price&order=asc&full_path=true&category='.$_GET['cat'];
$fp = fopen($cat_url, "rb");
$cats = "";
while(!feof($fp)) {
$cats.= fread($fp,1024);
}
fclose($fp);
echo $cats;
You see, this returns file.php but if accessed in a browser, it pops-up for download.... it's not returning the proper headers anymore!!