Salvare file su PC client invece che su server - Script XDCC Fetcher

duemila2

Nuovo Utente
25 Nov 2010
3
0
0
Buongiorno a tutti del Forum!
Ho deciso di chiedere il vostro aiuto dopo una mattinata di ricerche infruttuose riguardo il mio problema.
Praticamente per un sito al quale sto lavorando avrei bisogno di uno script che acceda alla rete IRC, si colleghi ad un server, si logghi in un canale e scarichi un pack da un bot utilizzando il comando XDCC.
Dopo un po' di ricerche ho trovato uno script (che si chiama XDCC Fetcher e viene rilasciato con licenza GNU) che sembra fare al caso mio.
Infatti fa esattamente quello che ho detto: dato il server, il bot e il numero di pack comincia lo scaricamento...il mio problema è che salva il file su una cartella del server.

Quindi vengo alla mia domanda: è possibile fare in modo che il file venga invece salvato sul pc del client, ovvero con la classica finestra di dialogo che chiede dove salvare il file e poi comincia lo scaricamento?

Grazie a tutti per la disponibilità!!!
Di seguito trovate il codice delle pagine principali, praticamente la pagina index chiede di inserire i dati per lo scaricamento e la pagina client.php lo esegue materialmente, quindi le modifiche sarebbero da fare probabilmente solo in questa pagina, ma non sono riuscito a capire come...comunque lo script è scaricabile interamente da http://webscripts.softpedia.com/scr...her--36626.html


client.php (la pagina che effettua materialmente la connessione e il salvataggio):
PHP:
<?php

set_time_limit(0);
ignore_user_abort(true);
register_shutdown_function("xfdie");

include "config.php";
include "raw.php";

if ($showrealtime == false) {
	echo "<script>window.location.href='index.php?clientstarted=yes&" . $_SERVER["QUERY_STRING"] . "';</script>";
	flush();
}
else {
	echo "<pre>";
}

$killed = false;
$handle = "";
$dcc = "";
$timer = "";

function xfwrite ($data, $echo = true) {
	if (substr($data,-1) != "\n") { $data .= "\n"; }
	fwrite($GLOBALS["fp"],$data);
	if ($echo) { xfecho($data, "blue"); }
}

function p ($num) {
	if (isset($GLOBALS["parse"][$num])) {
		return $GLOBALS["parse"][$num];
	}
}

function savetofile () {
	$dccgettemp = "";
	$dccgettemp = fgets($GLOBALS["dcc"],1024);
	if ($dccgettemp != "") {
		$GLOBALS["dccget"] = $dccgettemp;
		$GLOBALS["currfilesize"] += strlen($dccgettemp);
		fwrite($GLOBALS["handle"], $dccgettemp);
	}
}

function xfecho ($data, $color = "black", $ts = 1) {
	if (($data != "") && ($data != "\n") && (file_exists($GLOBALS["logfilename"]))) {
		if (substr($data,-1) != "\n") { $data .= "\n"; }

		if ($ts == 1) {
			$write = time() . " " . $color . " " . $data;
		}
		elseif ($color == "") {
			$write = $data;
		}
		else {
			$write = $color . " " . $data;
		}
		fwrite($GLOBALS["logfile"],$write);
		if ($GLOBALS["showrealtime"]) { echo $write; }
	}
}

function xfdie () {
	if ($GLOBALS["killed"] == false) {
		if ($GLOBALS["handle"]) { fclose($GLOBALS["handle"]); }
		if (($GLOBALS["dcc"]) && (!feof($GLOBALS["dcc"]))) { fclose($GLOBALS["dcc"]); }
		if ($GLOBALS["lockfilename"] && $GLOBALS["lockfilename"] != "" && file_exists($GLOBALS["lockfilename"])) { @unlink($GLOBALS["lockfilename"]); }
		if (($GLOBALS["fp"]) && (!feof($GLOBALS["fp"]))) {
			xfwrite("PRIVMSG " . $GLOBALS["user"] . " :XDCC REMOVE");
			xfwrite("PRIVMSG " . $GLOBALS["user"] . " :XDCC REMOVE " . $GLOBALS["pack"]);
			xfwrite("QUIT :XDCC Fetcher 0.1 beta (build 20050305) http://xdccfetcher.sourceforge.net");
			sleep(5);
			if (!feof($GLOBALS["fp"])) { fclose($GLOBALS["fp"]); }
		}
		xfecho("process killed (connection status: " . connection_status() . ")");
		fclose($GLOBALS["logfile"]);
		$GLOBALS["killed"] = true;
		die();
	}
}


// Initialisation variables
$server = ltrim(rtrim($_GET["server"]));
$port = ltrim(rtrim($_GET["port"]));
$channel = ltrim(rtrim($_GET["channel"]));
if (substr($channel,0,1) != "#") { $channel = "#" . ltrim(rtrim($channel)); }
$user = $_GET["user"];
$pack = $_GET["pack"];
if (substr($pack,0,1) != "#") { $pack = "#" . ltrim(rtrim($pack)); }
$join = 0;
$joined = 0;
$ison = 0;
$percent = -1;
while ((!isset($nick)) || file_exists($logfilename)) {
	$nick = "xf" . rand(10000,99999);
	$logfilename = $logsfolder . $nick . ".log";
	$delfilename = $logsfolder . $nick . ".del";
}
$logfile = fopen($logfilename, 'a');


while (1 == 1) {
	$fp = @fsockopen($server, $port, $errno, $errstr, 30);
	if (!$fp) {
		xfecho("$errstr ($errno)");
		xfdie();
	}
	else {
		stream_set_blocking($fp,0);
		xfwrite("NICK " . $nick);
		xfwrite("USER " . $nick . " \"xdccfetcher.com\" \"$server\" :xdccfetcher.sourceforge.net");

		while (!feof($fp)) {
			$fparr = array($fp);
			stream_select($fparr, $write = NULL, $except = NULL, 3);
			$get = fgets($fp);
			$parse = explode(" ",$get);
			CheckRaw($get);
			if (rtrim($get) != "" && p(0) != "PING") {
				if ($logall == true || (stristr($get,$user) && p(2) == $nick)) { xfecho($get); }
			}
			if (p(0) == "PING") {
				xfecho("PING? PONG!","green");
				xfwrite("PONG " . substr(p(1), 1),false);
			}
			elseif ((p(1) == "PRIVMSG") && (p(2) == $nick) && (p(3) == ":STOPXF")) {
				xfecho("Manual abort");
				xfdie();
			}
			elseif ((p(1) == "PRIVMSG") && (p(2) == $nick) && (p(3) == ":COMMANDXF")) {
				$string = "";
				for ($x=4; $x<count($parse); $x++) { $string .= $parse[$x] . " "; }
				if ($string != "") { xfwrite(rtrim($string)); }
			}
			elseif (!file_exists($logfilename)) {
				xfdie();
			}
			elseif (file_exists($delfilename)) {
				@unlink($delfilename);
				sleep(2);
				fclose($logfile);
				@unlink($logfilename);
				xfdie();
			}
			elseif ((stristr($get,$user)) && (stristr($get,"all slots full")) && (!stristr($get,"Added you")) && (p(1) == "NOTICE") && (p(2) == $nick)) {
				$timer = time() + 30;
			}
			elseif ((time() >= $timer) && ($timer != 0)) {
				$timer = 0;
				xfwrite("PRIVMSG " . $user . " :XDCC SEND " . $pack . "");
			}
			elseif ((stristr(p(0),$user)) && (p(3) == ":DCC")) {
				if (p(4) == "SEND") {
					echo "Starting DCC...\n";
					$DCCfilesize = (int)(substr(p(8),0,-3));
					$DCCfilename = p(5);
					$DCCip = long2ip(p(6));
					$DCCport = p(7);
					$filename = $downloadfolder . $DCCfilename;
				}
				elseif (p(4) == "ACCEPT") {
					echo "Resume accepted...\n";
				}
				if ((file_exists($filename)) && (p(4) == "SEND")) {
					if (filesize($filename) >= $DCCfilesize) {
						xfecho("File already downloaded");
						xfdie();
					}
					xfecho("Attempting resume...");
					xfwrite("PRIVMSG " . $user . " :DCC RESUME " . $DCCfilename . " " . $DCCport . " " . filesize($filename) . "");
				}
				else {
					xfecho("Connecting to $DCCip on port $DCCport ($DCCfilesize bytes)...");
					$dcc = @fsockopen($DCCip, $DCCport, $errno, $errstr, 30);
					if (!$dcc) {
						xfecho("$errstr ($errno)");
						xfdie();
					}
					else {
						stream_set_blocking($dcc,0);
						xfecho("connected...");
						$filename = $downloadfolder . $DCCfilename;
						if (file_exists($filename . ".lck")) {
							$filename = $downloadfolder . $nick . ".sav";
						}

						$lockfilename = $filename . ".lck";

						$handle = fopen($lockfilename, 'a');
						fclose($handle);

						if (file_exists($filename)) {
							$currfilesize = filesize($filename);
						}
						else {
							$currfilesize = 0;
						}
						$handle = fopen($filename, 'a');

						while (!feof($dcc)) {
							savetofile();
							if (!feof($fp)) {
								$get = fgets($fp);
								if ($get) {
									$parse = explode(" ",$get);
									if (p(0) == "PING") {
										xfecho($get);
										xfwrite("PONG " . substr(p(1), 1));
									}
									elseif ((p(1) == "PRIVMSG") && (p(2) == $nick) && (p(3) == ":STOPXF")) {
										xfecho("Manual abort");
										xfdie();
									}
									elseif ((p(1) == "PRIVMSG") && (p(2) == $nick) && (p(3) == ":COMMANDXF")) {
										$string = "";
										$x = 4;
										while (p(x) != "") {
											$string .= $p($x) . " ";
											$x++;
										}
										if ($string != "") { xfwrite(rtrim($string)); }
									}
								}
							}
							$currpercent = (int)(($currfilesize / $DCCfilesize) * 100);
							if ($currpercent > $percent) {
								$percent = $currpercent;
								xfecho("<script>document.title='" . $percent . "% completed - " . $DCCfilename . " - " . $nick . "';</script>", "", false);
							}
							if (!file_exists($logfilename)) {
								xfdie();
							}
							elseif (file_exists($delfilename)) {
								@unlink($delfilename);
								sleep(2);
								fclose($logfile);
								@unlink($logfilename);
								xfdie();
							}
							elseif ($currfilesize >= $DCCfilesize) {
								xfecho("Downloaded!");
								xfdie();
							}
							elseif ($currfilesize > $DCCfilesize) {
								xfecho("Current filesize is greater than expected! Aborting.");
								xfdie();
							}
							$dccarr = array($dcc);
							@stream_select($dccarr, $write = NULL, $except = NULL, 3);
						}
						if (filesize($filename) < $DCCfilesize) {
							xfecho("aborted.");
							fclose($dcc);
							@unlink($lockfilename);
							fclose($handle);
							xfwrite("PRIVMSG " . $user . " :XDCC SEND " . $pack . "");
						}
					}
				}
			}
		}
	}

	xfecho("Disconnected from server! Reconnecting in 60 seconds...");
	sleep(60);
}
?>
</pre>

config.php
PHP:
<?php

// Download folder
$downloadfolder = "downloads";

// Logs folder
$logsfolder = "/logs";

// Debug Modes
$showrealtime = true;
$logall = false;

?>
 
raw.php:
PHP:
<?php

$raw['004']['command'] = "GetServerName";
$raw['004']['pretext'] = "Connected to server (#xf#server#xf#)";
$raw['004']['precolor'] = "red";
function GetServerName($rawexplode) { $server = $rawexplode[3]; }




$raw['376']['command'] = "IsOn";
$raw['376']['ttext'] = "Checking if #xf#user#xf# is online...";
$raw['376']['tcolor'] = "green";
$raw['MODE'] = $raw['376'];
function IsOn ($rawexplode) {
	if ($GLOBALS['ison'] == 0) {
		$GLOBALS['ison'] = 1;
		xfwrite("ISON " . $GLOBALS['user'], false);
		return true;
	}
	else { return false; }
}




$raw['303']['command'] = "JoinChannel";
$raw['303']['ttext'] = "User is online. Attempting to join #xf#channel#xf#...";
$raw['303']['tcolor'] = "green";
$raw['303']['ftext'] = "User is NOT online!";
$raw['303']['fcolor'] = "red";
$raw['303']['fquit'] = 1;
function JoinChannel ($rawexplode) {
	if ($rawexplode[3] == ":" . $GLOBALS['user']) {
		$GLOBALS['join'] = 1;
		xfwrite("JOIN " . $GLOBALS['channel'], false);
		return true;
	}
	else { return false; }
}




$raw['366']['command'] = "SendRequest";
$raw['366']['ttext'] = "Successfully joined #xf#channel#xf#. Attempting to retrieve pack #xf#pack#xf# from #xf#user#xf#";
$raw['366']['tcolor'] = "green";
$raw['366']['ftext'] = "Successfully rejoined #xf#channel#xf#";
$raw['366']['fcolor'] = "red";
function SendRequest ($rawexplode) {
	if ($GLOBALS['joined'] == 0) {
		$GLOBALS['joined'] = 1;
		xfwrite("PRIVMSG " . $GLOBALS['user'] . " :XDCC SEND " . $GLOBALS['pack'] . "", false);
		return true;
	}
	else { return false; }
}




$raw['PART']['command'] = "UserAction";
$raw['PART']['ttext'] = "User has parted #xf#channel#xf#!";
$raw['PART']['tcolor'] = "red";
function UserAction ($rawexplode) {
	if (substr($rawexplode[0],0,strlen($GLOBALS['user'])+2) == ":" . $GLOBALS['user'] . "!") { return true; }
	else { return false; }
}




$raw['JOIN']['command'] = "UserAction";
$raw['JOIN']['ttext'] = "User has rejoined #xf#channel#xf#!";
$raw['JOIN']['tcolor'] = "red";




$raw['QUIT']['command'] = "UserAction";
$raw['QUIT']['ttext'] = "User has quit IRC!";
$raw['QUIT']['tcolor'] = "red";
$raw['QUIT']['tquit'] = 1;




$raw['NICK']['command'] = "ChangedNick";
$raw['NICK']['ttext'] = "User has changed nick to #xf#user#xf#";
$raw['NICK']['tcolor'] = "blue";
function ChangedNick ($rawexplode) {
	if (substr($rawexplode[0],0,strlen($GLOBALS['user'])+2) == ":" . $GLOBALS['user'] . "!") {
		return true;
		$GLOBALS['user'] = substr($rawexplode[2],1);
	}
	else { return false; }
}




$raw['KICK']['command'] = "Kicked";
$raw['KICK']['tcolor'] = "red";
function Kicked ($rawexplode) {
	if ($rawexplode[3] == $GLOBALS['user']) {
		$GLOBALS['raw']['KICK']['ttext'] = "User was kicked from #xf#user#xf#";
		return true;
	}
	elseif ($rawexplode[3] == $GLOBALS['nick']) {
		$GLOBALS['raw']['KICK']['ttext'] = "You were kicked by #xf#user#xf#. Attempting to rejoin...";
		xfwrite("JOIN " . $GLOBALS['channel'], false);
		return true;
	}
	else { return false; }
}




$raw['471']['pretext'] = "Cannot join #xf#channel#xf# as the channel has too many users!";
$raw['471']['precolor'] = "red";
$raw['471']['quit'] = 1;




$raw['473']['pretext'] = "Cannot join #xf#channel#xf# as the channel is invite-only!";
$raw['473']['precolor'] = "red";
$raw['473']['quit'] = 1;




$raw['474']['pretext'] = "Cannot join #xf#channel#xf# as you are banned!";
$raw['474']['precolor'] = "red";
$raw['474']['quit'] = 1;




$raw['475']['pretext'] = "Cannot join #xf#channel#xf# as the channel requires a key!";
$raw['475']['precolor'] = "red";
$raw['475']['quit'] = 1;




$raw['477']['pretext'] = "Cannot join #xf#channel#xf# as you need a registered nick!";
$raw['477']['precolor'] = "red";
$raw['477']['quit'] = 1;




$raw['485']['pretext'] = "Cannot join #xf#channel#xf# due to an unknown reason!";
$raw['485']['precolor'] = "red";
$raw['485']['quit'] = 1;




$raw['401']['pretext'] = "User is NOT online!";
$raw['401']['precolor'] = "";
$raw['401']['quit'] = 1;




$raw['433']['command'] = "ChangeNick";
function ChangeNick ($rawexplode) {
	$GLOBALS['nick'] = "xf" . rand(10000,99999);
	xfwrite("NICK " . $GLOBALS['nick']);
	fclose($GLOBALS['logfile']);
	@unlink($GLOBALS['logfilename']);
	$GLOBALS['logfilename'] = $GLOBALS['logsfolder'] . $GLOBALS['nick'] . ".log";
	$GLOBALS['delfilename'] = $GLOBALS['logsfolder'] . $GLOBALS['nick'] . ".del";
	$GLOBALS['logfile'] = fopen($GLOBALS['logfilename'], 'a');
}




$raw['AUTH']['pretext'] = "#xf#get#xf#";
$raw['AUTH']['precolor'] = "brown";



$raw['PRIVMSG']['command'] = "VersionReply";
$raw['PRIVMSG']['ttext'] = "Version request received from #xf#versionnick#xf#. Reply sent.";
$raw['PRIVMSG']['tcolor'] = "red";
function VersionReply ($rawexplode) {
	if (substr($rawexplode[3],0,10) == ":VERSION") {
		$versionnickparse = split('!',$rawexplode[0]);
		$GLOBALS['versionnick'] = substr($versionnickparse[0],1);
		xfwrite("NOTICE " . $GLOBALS['versionnick'] . " :VERSION XDCC Fetcher 0.1 beta - http://xdccfetcher.sourceforge.net", false);
		return true;
	}
}

function CheckRaw ($line) {
	$rawexplode = explode(" ",$line);
	if (isset($rawexplode[1])) {
		$rawcode = $rawexplode[1];
		$commandreturn = true;
		if (isset($GLOBALS['raw'][$rawcode]['pretext'])) { RawEcho($GLOBALS['raw'][$rawcode]['pretext'],$GLOBALS['raw'][$rawcode]['precolor']); }
		if (isset($GLOBALS['raw'][$rawcode]['command'])) { eval("$" . "commandreturn = " . $GLOBALS['raw'][$rawcode]['command'] . "($" . "rawexplode);"); }
		if (isset($GLOBALS['raw'][$rawcode]['posttext'])) { RawEcho($GLOBALS['raw'][$rawcode]['posttext'],$GLOBALS['raw'][$rawcode]['postcolor']); }
		if ($commandreturn == true) {
			if (isset($GLOBALS['raw'][$rawcode]['ttext'])) { RawEcho($GLOBALS['raw'][$rawcode]['ttext'],$GLOBALS['raw'][$rawcode]['tcolor']); }
			if (isset($GLOBALS['raw'][$rawcode]['tquit']) && (!isset($GLOBALS["handle"]) || $GLOBALS["handle"] == $false)) { xfdie(); }
		}
		else {
			if (isset($GLOBALS['raw'][$rawcode]['ftext'])) { RawEcho($GLOBALS['raw'][$rawcode]['ftext'],$GLOBALS['raw'][$rawcode]['fcolor']); }
			if (isset($GLOBALS['raw'][$rawcode]['fquit']) && (!isset($GLOBALS["handle"]) || $GLOBALS["handle"] == $false)) { xfdie(); }
		}
		if (isset($GLOBALS['raw'][$rawcode]['quit']) && (!isset($GLOBALS["handle"]) || $GLOBALS["handle"] == $false)) { xfdie(); }
	}
}

function RawEcho ($text,$color) {
	xfecho(preg_replace('/#xf#(\w+)#xf#/e', '\$GLOBALS["\\1"]', $text), $color);
}
?>


index.php

PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>XDCC Fetcher</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
TABLE.Section {
	border:solid 1px #333333;
	width:300;
	margin-bottom: 25px;
}
TD {
	font-family: Verdana, Arial;
	font-size: 12px;
	color: #333333;
}
TD.Section {
	padding:5px;
}
.TableTitle {
	position: relative;
	top: -15px;
	padding-left: 2px;
	padding-right: 2px;
	color: #333333;
	background-color: #CCCCCC;
	font-weight: bold;
	font-size: 10px;
}
FORM {
	margin: 0px;
}
INPUT {
	font-size: 10px;
	border:solid 1px #333333;
	background-color: #FFFFFF;
	color:#333333;
}
.ClientText {
	font-weight: bold;
	font-size: 10px;
	color: #FF0000;
}
.ClientList {
	font-size: 10px;
	position: absolute;
	visibility: hidden;
}

.ClientList A {
	padding-left: 15px;
	color: #333333;
	font-size: 12px;
}
IMG {
	width: 300px;
	height: 32px;
	border: 0px;
	margin-top: 30px;
	margin-bottom: 15px;
}
.CopyRight {
	font-family: Verdana, Arial;
	font-size: 10px;
	color: #999999;
	text-align: center;
}
</style>
</head>
<body bgcolor="#CCCCCC">
<center><img src="logo.gif"></center>
<table align="center" class="Section">
  <tr>
    <td class="Section"><span class="TableTitle">Connected Clients</span><br>
    <div id="ClientList" class="ClientList"></div>
    <div id="ClientText" class="ClientText">
    <?php
    if (isset($_GET["clientstarted"]) && $_GET["clientstarted"] == "yes") {
    	echo "Client started! ";
    }
    elseif (isset($_GET["clientstopped"]) && $_GET["clientstopped"] == "yes") {
    	echo "Client stopped! ";
    }
    ?>Loading client list...</div>
    </td>
  </tr>
</table>
<table align="center" class="Section">
  <tr>
    <td class="Section"><span class="TableTitle">Add New Client</span><br><form method="GET" action="startclient.php">
        <table cellpadding="0" cellspacing="0">
          <tr>
            <td>IRC server address:</td>
            <td width="10"></td>
            <td><input name="server" type="text" size="25" value="<?php echo showContent("server"); ?>"></td>
          </tr>
          <tr>
            <td>IRC server port:</td>
            <td width="10"></td>
            <td><input name="port" type="text" size="4" value="<?php echo showContent("port","6667"); ?>"></td>
          </tr>
          <tr>
            <td>IRC channel:</td>
            <td width="10"></td>
            <td><input name="channel" type="text" size="15" value="<?php echo showContent("channel"); ?>"></td>
          </tr>
          <tr>
            <td>User nick:</td>
            <td width="10"></td>
            <td><input name="user" type="text" size="15" value="<?php echo showContent("user"); ?>"></td>
          </tr>
          <tr>
            <td>Pack number:</td>
            <td width="10"></td>
            <td><input name="pack" type="text" size="4" value="<?php echo showContent("pack"); ?>"></td>
          </tr>
          <tr>
            <td align="center" colspan="3"><br>
              <input type="submit" value="GO GET IT!"></td>
          </tr>
        </table>
      </form></td>
  </tr>
</table>
<div class="CopyRight">XDCC Fetcher 0.1 beta. Copyright &copy; 2005 Mark Cilia Vincenti</div>
<div class="CopyRight">Comments &amp; downloads @ http://xdccfetcher.sourceforge.net</div>
<?php

include "config.php";

function showContent($field, $default = "") {
	if (isset($_GET[$field])) {
		if ($_GET[$field] == "") {
			return $default;
		}
		else {
			return $_GET[$field];
		}
	}
	else {
		return $default;
	}
}

echo "
<iframe name=\"ClientRef\" src=\"jsgetclientlist.php\" width=\"0\" height=\"0\"></iframe>
<script language=\"JavaScript\">
var oldclients = new Array(9);
var clients = new Array(9);
var oldclientscounter = -2;
var clientscounter = -1;
var flag = 0;
var counter = 0;

function ShowClients() {
	if (oldclientscounter == clientscounter) {
		flag = 0;
		for (counter = 0; counter <= clientscounter; counter++) {
			if (clients[counter] != oldclients[counter]) { flag = 1; }
		}
	}
	else {
		flag = 1;
	}
	if (flag == 1) {
		if (oldclientscounter >= 0) { document.getElementById('ClientList').innerHTML=''; }
		for (counter = 0; counter <= clientscounter; counter++) {
			document.getElementById('ClientList').innerHTML+=(counter + 1) + '<a href=\"showlog.php?log=' + clients[counter] + '\">' + clients[counter] + '</a><a href=\"showlog.php?log=' + clients[counter] + '\">view</a><a href=\"stopclient.php?log=' + clients[counter] + '\">stop</a><br>';
		}
		oldclients = clients;
		oldclientscounter = clientscounter;
		if (clientscounter >= 0) {
			ClientList.style.visibility='visible';
			ClientList.style.position='relative';
			ClientText.style.visibility='hidden';
			ClientText.style.position='absolute';
			document.getElementById('ClientText').innerHTML='';
		}
		else {
			ClientText.style.visibility='visible';
			ClientText.style.position='relative';
			ClientList.style.visibility='hidden';
			ClientList.style.position='absolute';
			document.getElementById('ClientText').innerHTML='There are currently no connected clients';
		}
	}
}
</script></body>
</html>";

/* XDCC Fetcher 0.1 beta (build 20050305)
Copyright (C) 2005  Mark Cilia Vincenti

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Comments, bugs etc @ [email protected] */

?>

startclient.php
PHP:
<?php

include "config.php";

if (substr(php_uname(), 0, 7) == "Windows" || $showrealtime == true) {
	header("Location: client.php?" . $_SERVER["QUERY_STRING"]);
}
else {
	exec("php client.php '&" . $_SERVER["QUERY_STRING"] . "' > /dev/null &");
	header("Location: index.php?clientstarted=yes&" . $_SERVER["QUERY_STRING"]);
}

/* XDCC Fetcher 0.1 beta (build 20050305)
Copyright (C) 2005  Mark Cilia Vincenti

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Comments, bugs etc @ [email protected] */

?>
 
Può cambiare ma viene deciso in automatico dallo script, ovvero è il nome che il file ha sul server da dove viene scaricato
 

Discussioni simili