deesse Posted September 12, 2007 Share Posted September 12, 2007 Hi, I would like to connect my other script to this URL: http://rdf.dmoz.org/rdf how to make this possible through a php script with the following order: 1- user is presented with 3 extensions to choose from. 2- depends on what user selects 3- if the selection is .gz, the rest of the extensions is set to false, then the script unzips the file and starts downloading the file from the URL 4- if selection is .txt, then .gz, rdf set to false and then .txt starts downloading. 5. if selection is .rdf, then .gz, txt set false, start downloading .rdf file. Not to be concerned of about where will the file be saved or stored temporary..... I have the following script in my possession: download, config and parse. your help is appreciated... thanks.... Quote Link to comment https://forums.phpfreaks.com/topic/68935-please-create-a-php-code-for-this/ Share on other sites More sharing options...
pocobueno1388 Posted September 12, 2007 Share Posted September 12, 2007 If you want someone to write code for you, post in the freelance forum. This is for help, not pawning all the work on others. At least attempt to write some of it, then when you get stuck ask for help. Quote Link to comment https://forums.phpfreaks.com/topic/68935-please-create-a-php-code-for-this/#findComment-346510 Share on other sites More sharing options...
cooldude832 Posted September 12, 2007 Share Posted September 12, 2007 agreed, but I must say I have seen freelance posting on real freelances site written much worse. Quote Link to comment https://forums.phpfreaks.com/topic/68935-please-create-a-php-code-for-this/#findComment-346513 Share on other sites More sharing options...
deesse Posted September 12, 2007 Author Share Posted September 12, 2007 Thanks for the reply..... You must know that I have already tried but not sure if correct or not.-.-...because it isn't working. hope you understand what i am trying to achieve here. thanks---- here is the snippet code: <?php $in=fopen($infile,"http://rdf.dmoz.org/rdf/") or die("cannot open $infile - does the file exist and is is allow_url_fopen on?\n"); $out=fopen($outfile,"http://rdf.dmoz.org/rdf/") or die("cannot write to $outfile - problem with permissions?\n"); while (!feof($in)) fwrite($out,fgets($in,1024)); fclose($out); fclose($in); die("File does not exist."); // exit() also works if (empty($_GET["file"])) { // ... } $filename = 'test.php'; if (strrchr($filename, ".") == ".gz") { // ... } header("Content-Length: " . filesize($filepath)); $fp = fopen($filepath, "r"); fpassthru($fp); // or... echo file_get_contents($filepath); ?> Quote Link to comment https://forums.phpfreaks.com/topic/68935-please-create-a-php-code-for-this/#findComment-346947 Share on other sites More sharing options...
deesse Posted September 15, 2007 Author Share Posted September 15, 2007 Is there anything that could be changed here ? I have made some changes for the script to work....but nope so far. thanks Quote Link to comment https://forums.phpfreaks.com/topic/68935-please-create-a-php-code-for-this/#findComment-348896 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.