pagedrop Posted April 6, 2009 Share Posted April 6, 2009 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>"; ?> Quote Link to comment https://forums.phpfreaks.com/topic/152707-file-grabber-problem/ Share on other sites More sharing options...
corbin Posted April 6, 2009 Share Posted April 6, 2009 http://www.tizag.com/phpT/postget.php Quote Link to comment https://forums.phpfreaks.com/topic/152707-file-grabber-problem/#findComment-801912 Share on other sites More sharing options...
pagedrop Posted April 6, 2009 Author Share Posted April 6, 2009 Hello, thank you for the reply. I have tried and the post and get methods, but was unable to retrieve a file from a input text field using the above php code. May be i was coding not correct, can you please modify the above code? thank you Quote Link to comment https://forums.phpfreaks.com/topic/152707-file-grabber-problem/#findComment-801935 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.