I'm making a script that enables you to download content off a server as it
is, so the data is as up to date as it could ever possibly be. I have this:

$number = 0;
$path = "/home/sites/site2/users/dan/web/servers/networks/";
print "Content-type:text/plain\n\n";
print qq~; Please send detailed suggestions, new servers, network errors,
and broken
; links to [EMAIL PROTECTED] Details on http://www.serverlistings.net

[servers]
~;
opendir(DIR,$path);
while ($file = readdir DIR) {
 next if $file eq '.' or $file eq '..';
 open(NETWORK,"$path$file");
 foreach $line (<NETWORK>) {
  chomp($line);
  if (substr($line,0,4) eq "PASS") {

  } else {
   ($net,$desc,$ports) = split(/\|/,$line);
   if (lc(substr($desc,0,6)) eq "random") {
    if (substr($desc,7) eq "") {
     $desc = "Random $file Server";
    } else {
     $desc = "Random " . substr($desc,7) . " $file Server";
    }
   }
   print "n$number=$desc" . "SERVER:$net:$ports" . "GROUP:$file\n";
   $number++;
  }
 }
 close(NETWORK);
}
closedir DIR;

however, if I click on the link on the web page which executes the
download.pl script, it appears either a) in the web browser, or b) as a
download.pl file. How can i make this so when clicking the link it creates a
servers.ini file on the fly?

Thanks in advance.

Dan



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to