|
Posted by Bernhard Kraft on 02/07/05 15:15
chris phillips wrote:
First of all:
> $file = file("download.php");
> $data = fread($file, filesize("download.php"));
> $data = chunk_split(base64_encode($data));
That won't ever work.
file(...) reads in the complete content of an file.
to open a file for reading with "fread" use "fopen"
The following code can retrieve the contents of the download.php script
if you have fURL wrappers enabled (safe mode disabled):
--------------snip--------------------
$fd = fopen("http://mysite.com/download.php", "rb");
while (!feof($fd)) {
$new = fread($fd, 100000);
$data .= $new;
if (!strlen($new)) break;
}
fclose($fd);
$data = chunk_split(base64_encode($data));
--------------snip--------------------
greets,
Bernhard
Navigation:
[Reply to this message]
|