help wml to html

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    help wml to html

    hi guys please help me convert this little script from wml to html i tried but got errors lol 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>");
    ?>

    #2
    PHP Code:
    header("Content-Type: text/vnd.wap.wml; charset=Utf-8"); 
    change that then edit wml tags to html add the body taggs
    and remove the anchor tag









    Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
    Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free

    Comment


      #3
      Lol can you do it for me pls.. ?

      Comment


        #4
        Try...

        PHP 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: application/vnd.wap.xhtml+xml');
        echo 
        '<?xml version="1.0" encoding="utf-8"?>
        <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" >
        <head>
        <meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=utf-8"/>
        </head>
        <body>
        <p style="text-align:left;font-size:small;">
        '
        .$st.'
        - - -<br/>'
        .$lks.'
        <a href="./">Назад</a>
        </p>
        </body></html>'
        ;
        ?>
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment


          #5
          Thanks :-)

          Comment


            #6
            U're welcome.
            <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

            Comment


              #7
              lol i was postn to teach him and u just gav him his answer lol noobs wont learn otherwise but all good









              Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
              Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free

              Comment


                #8
                uuups, my mistake. I apologize.
                <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                Comment


                  #9
                  its how i learnt in the good old days of black nd white screens and pages were basic and the most popular script was neocult cgi people like neo and sub would giv me tips and id have to figure it out from there its what made me a good coder over the years









                  Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer..
                  Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free

                  Comment


                    #10
                    I hope that Naveed is reading this... Should other like too.
                    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                    Comment


                      #11
                      Originally posted by arnages View Post
                      I hope that Naveed is reading this... Should other like too.
                      well i guess u r right but anyways thanks a ton for help. cheers!!!

                      Comment


                        #12
                        now pls help me add country flag to this script as it shows ip and browsers only

                        Comment


                          #13
                          Get the IP2country database, some country flag icons from iconarchive, some thinking and you are done.
                          Perfection comes at a cost



                          I accept liberty!

                          Comment


                            #14
                            the first two things i almost did pls do the last one for me lol

                            Comment


                              #15
                              Dude, the first two have already been made for you. Just make the third. Lol.

                              Lemme give you a hint. Wherever you got The database, there is a tutorial for using it.

                              You can rename your flags to a match the output from the database, then output an image using

                              <img src="path_to_flags/$country.png" />

                              Where $country is the output from the database which should match the respective flag.
                              Perfection comes at a cost



                              I accept liberty!

                              Comment

                              Working...
                              X