Wml To Php

Started on the old forum in June 2007 · view the original in the archive · old links redirect here

3 replies · 553 views · started 19 years ago · 1 min read

3 participants
Guest #1

dear wap/web masters, cud plz explain me how to convert a wml file to php file in easily and quickly? [ex: if i want to convert this file to http://arawap.net/services/codes/nokia.wml tonokia.php ] i kno how to do it in note pad . but is there any wau to do dat usin a software or smtin else? plz reply ur ideas...

WhiteWarrior Principal · 1,419 posts #2

dear wap/web masters, cud plz explain me how to convert a wml file to php file in easily and quickly? [ex: if i want to convert this file to http://arawap.net/services/codes/nokia.wml tonokia.php ] i kno how to do it in note pad . but is there any wau to do dat usin a software or smtin else? plz reply ur ideas...

i dont think you can convert things to php, never seen the software to do it lol put the code up here and ill do it for ya

alesh Lead · 604 posts #3

dear wap/web masters, cud plz explain me how to convert a wml file to php file in easily and quickly? [ex: if i want to convert this file to http://arawap.net/services/codes/nokia.wml tonokia.php ] i kno how to do it in note pad . but is there any wau to do dat usin a software or smtin else? plz reply ur ideas...

if im right bro, u want it 4 ur site right? try this..... lol

<?php
include("config.php");
include("core.php");
//session_start();
header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-store, no-cache, must-revalidate");
print "<?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

$bcon = connectdb();
if (!$bcon)
{
    echo "<card id=\"main\" title=\"ur site (ERROR!)\">";
    echo "<p align=\"center\">";
    echo "<img src=\"images/exit.gif\" alt=\"*\"/>
";
    echo "ERROR! cannot connect to database

";
    echo "This error happens usually when backing up the database, please be patient, The site will be up any minute

";
    echo "[b]THANK YOU VERY MUCH[/b]";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    exit();
}
$brws = explode(" ",$HTTP_USER_AGENT);
$brws2 = explode("(",$HTTP_USER_AGENT); 
$brws3 = explode(")",$brws2[1]);
$brws4 = $brws2[0]."/".$brws3[0]."/".$brws3[1];
$ubr = $brws[0];
$uip = getip();
$action = $_GET["action"];
$sid = $_GET["sid"];
$page = $_GET["page"];
$who = $_GET["who"];

$uid = getuid_sid($sid);

cleardata();
if(isipbanned($uip,$ubr))
    {
      if(!isshield(getuid_sid($sid)))
      {
        echo "<card id=\"main\" title=\"ur site\">";
      echo "<p align=\"center\">";
      echo "<img src=\"images/notok.gif\" alt=\"x\"/>
";
      echo "This IP address is blocked
";
      echo "
";
      echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over

";
      $banto = mysql_fetch_array(mysql_query("SELECT  timeto FROM ibwf_penalties WHERE  penalty='2' AND ipadd='".$uip."' AND browserm='".$ubr."' LIMIT 1 "));
      //echo mysql_error();
      $remain =  $banto[0] - time();
      $rmsg = gettimemsg($remain);
      echo " IP: $rmsg

";
      
      echo "</p>";
      echo "

";
  echo "UserID: <input name=\"loguid\" format=\"*x\" maxlength=\"30\"/>
";
  echo "Password: <input type=\"password\" name=\"logpwd\"  maxlength=\"30\"/>
";
  echo "<anchor>LOGIN<go href=\"login.php\" method=\"get\">";
  echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>";
  echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>";
  echo "</go></anchor>";
  echo "</p>";
      echo "</card>";
      echo "</wml>";
      exit();
      }
    }
if(($action != "") && ($action!="terms"))
{
    $uid = getuid_sid($sid);
    if((islogged($sid)==false)||($uid==0))
    {
        echo "<card id=\"main\" title=\"ur site\">";
      echo "<p align=\"center\">";
      echo "You are not logged in
";
      echo "Or Your session has been expired

";
      echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</card>";
      echo "</wml>";
      exit();
    }
    
    
    
}
//echo isbanned($uid);
if(isbanned($uid))
    {
        echo "<card id=\"main\" title=\"ur site\">";
      echo "<p align=\"center\">";
      echo "<img src=\"images/notok.gif\" alt=\"x\"/>
";
      echo "You are [b]Banned[/b]
";
      $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid='".$uid."' AND penalty='1'"));
      $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
      
      $remain = $banto[0]- time();
      $rmsg = gettimemsg($remain);
      echo "Time to finish your penalty: $rmsg

";
      echo "Ban Reason: $banres[0]";
      //echo "<a href=\"index.php\">Login</a>";
      echo "</p>";
      echo "</card>";
      echo "</wml>";
      exit();
    }
$res = mysql_query("UPDATE ibwf_users SET browserm='".$brws4."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");

////////////////////////////////////////MAIN PAGE
if($action=="phones")
{
  addvisitor();
  addonline(getuid_sid($sid),"phones","");
  //saveuinfo($sid);
  
      echo "<card id=\"main\" title=\"ur site\">";
  echo "<p align=\"center\">";
  echo "<a href=\"phones.php?action=nokia&sid=$sid\">Nokia</a>
";
  echo "<a href=\"phones.php?action=siemens&sid=$sid\">Siemens</a>
";
  
  echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
else if($action=="nokia")
{
    echo "<card id=\"main\" title=\"ur site\">";
    echo "<p align=\"center\">";
    echo"*3370# 
Activate Enhanced Full Rate Codec (EFR) - Your phone uses the best sound quality but talk time is reduced my approx. 5%
";
    
    echo "<a href=\"phones.php?action=phones&sid=$sid\">back</a>
";
    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
    echo "</card>";
}
else if($action=="siemens")
{
    echo "<card id=\"main\" title=\"ur site\">";
    echo "<p align=\"center\">";
    echo"All Siemens Phones: 
Service Provider Unlock: *#0003*(secret code 8 digits)#
";
    
    echo "<a href=\"phones.php?action=phones&sid=$sid\">back</a>
";
    echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
    echo "</card>";
}
?>
</wml>

eeeeerrr....

GumSlone Administrator Principal · 1,690 posts #4

You can also add this line to your .htaccess than you can add a php code into your wml files, dont forget the correct header in your files.

AddType application/x-httpd-php wml

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Sign in to reply.

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close