<?PHP header("Content-type: text/vnd.wap.wml") ?>
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<template>
<do type="prev" label="Zp&#x011B;t"><prev/></do>
<do type="accept" label="Hlavn&#xED;"><go href="index.php"/></do>
</template>
<card id="srvsw" title="Server SW">
<p>
<?PHP if (empty($addr)) { ?>
Adresa serveru <input type="text" name="addr" title="Adresa"/><br/>
<anchor>Zjistit SW<go href="srvstat.php" method="get">
<postfield name="addr" value="$(addr)"/>
</go></anchor>
<?PHP
}
else {
$fp = FSockOpen($addr,80);
if ($fp) {
FputS($fp, "HEAD / HTTP/1.0\n\n");
while ($line=FGetS($fp,128)) {
if (ERegI("^Server:.*$", $line)) {
echo $line."<br/>";
break;
}
}
FClose($fp);
}
else 
echo "Server neodpov&#xED;d&#xE1;<br/>";
}
// (C)2002 Pavel Rùžièka, pavel.ruzicka@supramax.cz
?>
</p>
</card>
</wml> 
