Hey there,
I am doing an fwrite to make an index.php page, its creating it just fine. But it isn’t putting in the variables.
[php]$exist = “…/files/$rar/index.php”;
$exist_handle = fopen($exist, ‘w’) or die(“can’t open file”);
$download_page = “<?php
$link = $uploadedfilename;
header(‘Content-Disposition: attachment; filename=’.basename($link).’’);
readfile($link);
exit();
?>”;
fwrite($exist_handle, $download_page);
fclose($exist_handle);
[/php]
It writes the page but this is what it turns out like:
[php]= ;
header(‘Content-Disposition: attachment; filename=’.basename().’’);
readfile();
exit();[/php]
Ideally I would it to write the index page to look like this:
[php]
$link = “mypicture.jpg” ;
header(‘Content-Disposition: attachment; filename=’.basename($link).’’);
readfile($link);
exit();[/php]
mypicture.jpg obviously being a variable written from the page that created the index.php page.
Thanks in advance!
James