hi guys please help me convert this little script from wml to html i tried but got errors lol
here is it
here is it
Code:
<?php
error_reporting(0);
include("cnfg.php");
$ms=mysql_connect($host,$login,$pass) or exit;
mysql_select_db($db) or exit;
$res=mysql_query("Select * From `online` Order By time Desc");
$mrp=array("SIE-"=>"Siemens ","MOT-"=>"Motorola "); $n=0; $arr=NULL; $st="";
while ($ar=mysql_fetch_array($res,MYSQL_ASSOC)) {$n++; $ua="";
$ua2=htmlspecialchars(str_replace('$','$$',trim(strtr($ar["ua"],$mrp))),ENT_QUOTES);
for ($i=0;$i<strlen($ua2);$i++) {
if (($ua2[$i]<>"/")&&($ua2[$i]<>" ")) {$ua.=$ua2[$i];} else {break;}
}
$arr[]="<b>$n</b>. ".trim($ar["ip"])."; $ua; ".date("H:i:s",$ar["time"])."<br/>";
}
mysql_close($ms);
$cnt=count($arr); $nm=15; $allp=ceil($cnt/$nm);
$p=trim($_GET['p']); if ($p<1) {$p=1;} elseif ($p>$allp) {$p=$allp;}
$begin=$p*$nm-$nm; if ($begin>$cnt-1) {$begin=0;}
$end=$begin+$nm; if ($end>$cnt-1) {$end=$cnt;}
for ($i=$begin;$i<$end;$i++) {$st.=$arr[$i];} $lks="";
if ($p>1) {$v=$p-1; $lks.="<a href=\"users.php?p=$v\">Предыдущие</a><br/>\r\n";}
if ($allp>$p) {$v=$p+1; $lks.="<a href=\"users.php?p=$v\">Следующие</a><br/>\r\n";}
if ($lks<>NULL) {$lks.="- - -<br/>";}
header("Content-Type: text/vnd.wap.wml; charset=Utf-8");
echo ("<?xml version=\"1.0\" encoding=\"Utf-8\"?><!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.2//EN\" \"http://www.wapforum.org/DTD/wml_1.2.xml\"><wml><head><meta forua=\"true\" http-equiv=\"Cache-Control\" content=\"no-cache\"/></head><card title=\"OnLine\">
<p align=\"left\"><small>
$st
- - -<br/>$lks
<anchor>Назад<prev/></anchor>
</small></p>
</card></wml>");
?>



Comment