I have a question about converting wml file to html...wml version of the script works but the html will not work. why?
wml file
html file
pease help
wml file
Code:
<?php header("Content-type: text/vnd.wap.wml;charset=UTF-8"); header("Cache-Control: no-store, no-cache, must-revalidate"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">"; ?> <wml> <?php include("../config.php"); include("../core.php"); connectdb(); $action = $_GET["action"]; $sid = $_GET["sid"]; $who = $_GET["who"]; $uid = getuid_sid($sid); $page = $_GET["page"]; if((islogged($sid)==false)||($uid==0)) { echo "<card id=\"main\" title=\"$nazivsajta\">"; echo "<p align=\"center\">"; echo "Niste ulogovani<br/>"; echo "ili vam je vreme isteklo!<br/><br/>"; echo "<a href=\"index.php\"><img src=\"images/login.gif\" alt=\"LOGIN\"/>Uloguj Se!</a>"; echo "</p>"; echo "</card>"; echo "</wml>"; exit(); } $uid = getuid_sid($sid); if(isbanned($uid)) { echo "<card id=\"main\" title=\"$nazivsajta\">"; echo "<p align=\"center\">"; echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>"; echo "Vi ste <b>banovani</b><br/>"; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM batica_penalties WHERE uid='".$uid."' AND penalty='1'")); $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM batica_ppl WHERE id='".$uid."'")); $remain = $banto[0]- time(28800); $rmsg = gettimemsg($remain); echo "Vreme do isteka bana: $rmsg<br/><br/>"; echo "Razlog Banovanja: $banres[0]"; //echo "<a href=\"index.php\">Login</a>"; echo "</p>"; echo "</card>"; echo "</wml>"; exit(); } addonline(getuid_sid($sid),"Rat Klanova",""); echo "<card id=\"main\" title=\"Rat Klanova\">"; include("on.php"); function first() { echo "<p align=\"center\"><small>"; echo "<a href=\"akmens.php?usr=$_GET[usr] &sid=$_GET[sid]&id=akmuo\">[Kamenolom]</a><br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=keisti_akmen\">[Promena radnika u kamenolomce]</a><br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=info\">[Informacije]</a><br/>"; echo "----------<br/>"; echo "<a href=\"zaidas.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[Meni Igre]</a></small></p>"; } function akmens_skaldykla_first() { $kk = mysql_fetch_array(mysql_query("SELECT akmuo, akmenskaldziai, data_skald FROM war WHERE usr = '$_GET[usr]' ")); $akmuo = strip_tags($kk['akmuo']); $akmenskaldziai = strip_tags($kk['akmenskaldziai']); $data_skald = strip_tags($kk['data_skald']); $data = date("ymdHis", strtotime("-20 minutes")); $skaldymas = $akmenskaldziai*2; if($data < $data_skald) {$veikla = "Odmor";} elseif($data >= $data_skald) {$veikla = "Spremni da rade";} echo "<p align=\"center\"><small>"; echo "Ti imas: <b>$akmenskaldziai</b> kamenolomaca<br/>"; echo "Oni mogu napraviti: <b>$skaldymas</b> kamena<br/>"; echo "Kamenolomci: <b>$veikla</b><br/>"; echo "---------<br/>"; echo "<anchor>[Posalji u kamenolom]<go method=\"post\" href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=skaldyti\"><postfield name=\"akmenskaldziai\" value=\"$akmenskaldziai\"/></go></anchor><br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } function skaldo_akmeni() { $ll = mysql_fetch_array(mysql_query("SELECT akmuo, akmenskaldziai, data_skald FROM war WHERE usr = '$_GET[usr]' ")); $akmuo = strip_tags($ll['akmuo']); $akmenskaldziai = strip_tags($ll['akmenskaldziai']); $data_skald = strip_tags($ll['data_skald']); $max_akm = $_POST[akmenskaldziai]*2; $priskaldyta = mt_rand(1, $max_akm); $dataa = date("ymdHis"); $dabar = date("ymdHis", strtotime("-20 minutes")); if (($_POST[akmenskaldziai] != "") && ($_POST[akmenskaldziai] != "0") && ($dabar >= $data_skald) && ($_POST[akmenskaldziai] == $akmenskaldziai)) { $new_akmuo = $akmuo + $priskaldyta; mysql_query("UPDATE war SET akmuo = '$new_akmuo', data_skald = '$dataa' WHERE usr = '$_GET[usr]' "); echo "<p align=\"center\"><small>"; echo "Kamenolomci: <b>$priskaldyta</b><br/>"; echo "Rezerve kamena: <b>+$priskaldyta</b><br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif(($_POST[akmenskaldziai] == "") || ($_POST[akmenskaldziai] == "0")) { echo "<p align=\"center\"><small>"; echo "Nemas kamenolomaca.<br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif($dabar < $data_skald) { echo "<p align=\"center\"><small>"; echo "Tvoji radnici su umorni.<br/>Moras ih odmoriti <b>20</b> minuta.<br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif($_POST[akmenskaldziai] != $akmenskaldziai) { echo "<p align=\"center\"><small>"; echo "Ponasanje!!!<br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } } function keisti_first() { $ll = mysql_fetch_array(mysql_query("SELECT darbininkai FROM war WHERE usr = '$_GET[usr]' ")); $darbininkai = strip_tags($ll['darbininkai']); echo "<p align=\"center\"><small>"; echo "Ovde mozes da promenis radnike u kamenolomce.<br/>Tvoji radnici: <b>$darbininkai</b><br/>Upisi koliko radnika menjas:<br/></small>"; echo "<input type=\"text\" format=\"5N\" name=\"darbin\"/><br/>"; echo "<small><anchor>[Promeni]<go method=\"post\" href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=keisti_akm\"><postfield name=\"darbin\" value=\"$(darbin)\"/></go></anchor><br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } function change() { $_POST[darbin] = str_replace("-", "", $_POST[darbin]); $z = mysql_fetch_array(mysql_query("SELECT darbininkai, akmenskaldziai FROM war WHERE usr = '$_GET[usr]' ")); $akmenskaldziai = strip_tags($z['akmenskaldziai']); $darbinink = strip_tags($z['darbininkai']); $new_darbin = $darbinink - $_POST[darbin]; $new_akmenskaldziai = $akmenskaldziai + $_POST[darbin]; if(is_numeric($_POST[darbin])) { if (($_POST[darbin] != "") && ($darbinink >= $_POST[darbin]) && ($_POST[darbin] > 0)) { mysql_query("UPDATE war SET darbininkai = '$new_darbin', akmenskaldziai = '$new_akmenskaldziai' WHERE usr = '$_GET[usr]' "); echo "<p align=\"center\"><small>"; echo "Promenjeno $_POST[darbin] radnika u $_POST[darbin] kamenolomce.<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif ($_POST[darbin] == "") { echo "<p align=\"center\"><small>"; echo "Nisu popunjena polja<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif($_POST[darbin] > $darbinink) { echo "<p align=\"center\"><small>"; echo "Nemas toliko radnika.<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif($_POST[darbin] <= 0) { echo "<p align=\"center\"><small>"; echo "Nemas radnika.<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } } else { echo "<p align=\"center\"><small>"; echo "Mozes upisati samo brojeve!!!<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } } function info() { echo "<p align=\"center\"><small>"; echo "<b>Kamenolom</b><br/>"; echo "U kamenolomu tvoji radnici prave zalihe kamena. Jedan radnik napravi dva kamena.<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } $db_connection = mysql_connect($db_host, $db_user, $db_pass); mysql_select_db($db_table, $db_connection); $tikr = mysql_num_rows(mysql_query("SELECT usr, pwd FROM war WHERE usr = '$_GET[usr]' ")); if($tikr == 1) { if($_GET[id] == "") {first();} elseif($_GET[id] == "akmuo") {akmens_skaldykla_first();} elseif($_GET[id] == "skaldyti") {skaldo_akmeni();} elseif($_GET[id] == "keisti_akmen") {keisti_first();} elseif($_GET[id] == "keisti_akm") {change();} elseif($_GET[id] == "info") {info();} } else { echo "<p align=\"center\">"; echo "<small>Nisi deo igre!!!<br/>"; echo "</small></p>"; } mysql_close($db_connection); echo "</card></wml>"; ?>
Code:
<?php header("Cache-Control: no-store, no-cache, must-revalidate"); header("Content-type: text/html; charset=UTF-8"); include("../core.php"); include("../config.php"); echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>"; echo "<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.0//EN\"\"http://www.wapforum.org/DTD/xhtml-mobile10.dtd\">"; echo "<html xmlns=\"http://www.w3.org/1999/xhtml\">"; echo "<head>"; echo "<title>$ime</title>"; echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"style/style.css\" />"; echo "</head>"; echo "<body>"; connectdb(); $action = $_GET["action"]; $sid = $_GET["sid"]; $who = $_GET["who"]; $rid=$_GET["rid"]; $uid = getuid_sid($sid); $usr=$_GET["usr"]; if((islogged($sid)==false)||($uid==0)) { echo "<p align=\"center\">"; echo "Niste Ulogovani!<br/>"; echo "Ili je vas pristupni period istekao!<br/><br/>"; echo "<a href=\"index.php\">Uloguj se!</a>"; echo "</p>"; exit(); } if(isbanned($uid)) { echo "<p align=\"center\">"; echo "<img src=\"images/notok.gif\" alt=\"x\"/><br/>"; echo "Vi ste <b>Banovani!</b><br/>"; $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM batica_penalties WHERE uid='".$uid."' AND penalty='1'")); $remain = $banto[0]- time(); $rmsg = gettimemsg($remain); echo "Vreme isteka Bana: $rmsg<br/><br/>"; //echo "<a href=\"index.php\">Ulogujte se!</a>"; echo "</p>"; exit(); } addonline(getuid_sid($sid),"Rat Klanova",""); include("on.php"); function first() { echo "<p align=\"center\"><small>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=akmuo\">[Kamenolom]</a><br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=keisti_akmen\">[Promena radnika u kamenolomce]</a><br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=info\">[Informacije]</a><br/>"; echo "----------<br/>"; echo "<a href=\"zaidas.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[Meni Igre]</a></small></p>"; } function akmens_skaldykla_first() { $kk = mysql_fetch_array(mysql_query("SELECT akmuo, akmenskaldziai, data_skald FROM war WHERE usr = '$_GET[usr]' ")); //$akmuo = strip_tags($kk['akmuo']); //$akmenskaldziai = strip_tags($kk['akmenskaldziai']); //$data_skald = strip_tags($kk['data_skald']); $akmuo = $kk[0]; $akmenskaldziai=$kk[1]; $data_skald =$kk[2]; $data = date("ymdHis", strtotime("-20 minutes")); $skaldymas = $akmenskaldziai*2; if($data < $data_skald) {$veikla = "Odmor";} elseif($data >= $data_skald) {$veikla = "Spremni da rade";} echo "<p align=\"center\"><small>"; echo "<form action=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=skaldyti\" method=\"post\">"; echo "Ti imas: <b>$akmenskaldziai</b> kamenolomaca<br/>"; echo "Oni mogu napraviti: <b>$skaldymas</b> kamena<br/>"; echo "Kamenolomci: <b>$veikla</b><br/>"; echo "---------<br/>"; echo "<postfield name=\"akmenskaldziai\" value=\"$akmenskaldziai\"/>"; echo "<br/><input type=\"Submit\" Name=\"Submit\" Value=\"Posalji u kamenolom\"></form>"; //echo "<anchor>[Posalji u kamenolom]<go method=\"post\" href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=skaldyti\"> <postfield name=\"akmenskaldziai\" value=\"$akmenskaldziai\"/></go></anchor><br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } function skaldo_akmeni() { $ll = mysql_fetch_array(mysql_query("SELECT akmuo, akmenskaldziai, data_skald FROM war WHERE usr = '$_GET[usr]' ")); //$akmuo = strip_tags($ll['akmuo']); //$akmenskaldziai = strip_tags($ll['akmenskaldziai']); //$data_skald = strip_tags($ll['data_skald']); $akmuo = $ll[0]; $akmenskaldziai=$ll[1]; $data_skald =$ll[2]; $max_akm = $_POST[akmenskaldziai]*2; $priskaldyta = mt_rand(1, $max_akm); $dataa = date("ymdHis"); $dabar = date("ymdHis", strtotime("-20 minutes")); if ( ($dabar >= $data_skald) && ($_POST[akmenskaldziai] == $akmenskaldziai)) { $new_akmuo = $akmuo + $priskaldyta; mysql_query("UPDATE war SET akmuo = '$new_akmuo', data_skald = '$dataa' WHERE usr = '$_GET[usr]' "); echo "<p align=\"center\"><small>"; echo "Kamenolomci: <b>$priskaldyta</b><br/>"; echo "Rezerve kamena: <b>+$priskaldyta</b><br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif(($_POST[akmenskaldziai] == "") || ($_POST[akmenskaldziai] == "0")) { echo "<p align=\"center\"><small>"; echo "Nemas kamenolomaca.<br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif($dabar < $data_skald) { echo "<p align=\"center\"><small>"; echo "Tvoji radnici su umorni.<br/>Moras ih odmoriti <b>20</b> minuta.<br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif($_POST[akmenskaldziai] != $akmenskaldziai) { echo "<p align=\"center\"><small>"; echo "Ponasanje!!!<br/>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } } function keisti_first() { $ll = mysql_fetch_array(mysql_query("SELECT darbininkai FROM war WHERE usr = '$_GET[usr]' ")); $darbininkai = strip_tags($ll['darbininkai']); echo "<p align=\"center\"><small>"; echo "<form action=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=keisti_akm\" method=\"post\">"; echo "Ovde mozes da promenis radnike u kamenolomce.<br/>Tvoji radnici: <b>$darbininkai</b><br/>Upisi koliko radnika menjas:<br/></small>"; echo "<input type=\"text\" format=\"5N\" name=\"darbin\"/><br/>"; echo "<postfield name=\"darbin\" value=\"$(darbin)\"/>"; echo "<br/><input type=\"Submit\" Name=\"Submit\" Value=\"Zameni\"></form>"; echo "---------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></p>"; } function change() { $_POST[darbin] = str_replace("-", "", $_POST[darbin]); $z = mysql_fetch_array(mysql_query("SELECT darbininkai, akmenskaldziai FROM war WHERE usr = '$_GET[usr]' ")); $akmenskaldziai = strip_tags($z['akmenskaldziai']); $darbinink = strip_tags($z['darbininkai']); $new_darbin = $darbinink - $_POST[darbin]; $new_akmenskaldziai = $akmenskaldziai + $_POST[darbin]; if(is_numeric($_POST[darbin])) { if (($_POST[darbin] != "") && ($darbinink >= $_POST[darbin]) && ($_POST[darbin] > 0)) { mysql_query("UPDATE war SET darbininkai = '$new_darbin', akmenskaldziai = '$new_akmenskaldziai' WHERE usr = '$_GET[usr]' "); echo "<p align=\"center\"><small>"; echo "Promenjeno $_POST[darbin] radnika u $_POST[darbin] kamenolomce.<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif ($_POST[darbin] == "") { echo "<p align=\"center\"><small>"; echo "Nisu popunjena polja<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif($_POST[darbin] > $darbinink) { echo "<p align=\"center\"><small>"; echo "Nemas toliko radnika.<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } elseif($_POST[darbin] <= 0) { echo "<p align=\"center\"><small>"; echo "Nemas radnika.<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } } else { echo "<p align=\"center\"><small>"; echo "Mozes upisati samo brojeve!!!<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } } function info() { echo "<p align=\"center\"><small>"; echo "<b>Kamenolom</b><br/>"; echo "U kamenolomu tvoji radnici prave zalihe kamena. Jedan radnik napravi dva kamena.<br/>"; echo "--------<br/>"; echo "<a href=\"akmens.php?usr=$_GET[usr]&sid=$_GET[sid]&id=\">[-Nazad-]</a></small></p>"; } $db_connection = mysql_connect($db_host, $db_user, $db_pass); mysql_select_db($db_table, $db_connection); $tikr = mysql_num_rows(mysql_query("SELECT usr, pwd FROM war WHERE usr = '$_GET[usr]' ")); if($tikr == 1) { if($_GET[id] == "") {first();} elseif($_GET[id] == "akmuo") {akmens_skaldykla_first();} elseif($_GET[id] == "skaldyti") {skaldo_akmeni();} elseif($_GET[id] == "keisti_akmen") {keisti_first();} elseif($_GET[id] == "keisti_akm") {change();} elseif($_GET[id] == "info") {info();} } else { echo "<p align=\"center\">"; echo "<small>Nisi deo igre!!!<br/>"; echo "</small></p>"; } mysql_close($db_connection); echo "</body>"; echo "</html>"; ?>
Comment