Jump to content

file grabber problem


pagedrop

Recommended Posts

Hello,

 

I have this code below to grab a given file name into the server.

I would to know and learn how to put a input box for this code, so the user can place any file url and the same file will be copied.

 

thank you

 

<?php

echo "script started\n";

echo "<br>";

$inputfile = fopen("http://www.google.com/homepage.css", "r");

$outputfile = fopen("homepage.css", "w");

echo "opened files\n";

echo "<br>";

$data = '';

while (!feof($inputfile)) {

  $data .= fread($inputfile, 8192);

}

echo "read data\n";

echo "<br>";

fwrite($outputfile, $data);

echo "transfered data\n";

echo "<br>";

fclose ($inputfile);

fclose ($outputfile);

echo "files closed\n";

echo "<br>";

echo "done";

echo "<br>";

?>

 

Link to comment
https://forums.phpfreaks.com/topic/152707-file-grabber-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.