$value) {
$aPostFields[$key] = urlencode($key) . '=' . urlencode($value);
}
return implode('&', $aPostFields);
}
$postFields['fname'] = $_POST['fname'];
$postFields['scode'] = $_POST['scode'];
$postFields['go'] = 'send';
$ch = curl_init('http://amxmodx.org/webcompiler.cgi');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.8.0.3) Gecko/20060426 Firefox/1.5.0.3');
curl_setopt($ch, CURLOPT_POSTFIELDS, createPostString($postFields));
$tresc = curl_exec($ch);
if (curl_errno($ch))
echo 'Blad #' . curl_errno($ch) . ': ' . curl_error($ch);
curl_close($ch);
if (strpos($tresc, "Your plugin successfully compiled!"))
{
$tresc = substr($tresc, strpos($tresc, "http://www.amxmodx.org/webcompiler.cgi?"));
$ile = strpos($tresc, "");
$link = substr($tresc, 0, $ile);
$tresc = substr($tresc, strpos($tresc, "Welcome to the AMX Mod X"));
$ile = strpos($tresc, "");
$inf = substr($tresc, 0, $ile);
$inf = str_replace("\r\n","
", $inf);
echo 'Kliknij w poniższy adres, aby pobrać plugin:
Pobierz
'.$inf.''; } else { $ktory = strpos($tresc, "Your plugin failed to compile"); $tresc = substr($tresc, $ktory + 63); $ile = strpos($tresc, ""); $tresc = substr($tresc, 0, $ile); echo 'Nie udało się skompilować pluginu.