Html To Wml

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

31 replies · 1,521 views · started 19 years ago · 1 min read

4 participants
amylee Principal · 1,092 posts #21

check all the spaces in between the <?php> ?> bits like this

?>

<wml>

<?php

would become

?>
<wml>
<?php

or something like that i think thats one possible cause of this type of error

learner Lead · 587 posts #22

that link dont work

amylee thats really very sweet of you i hope i can figure how to use the codes

amy other than those rest of the coding r fine????

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

Guest #23

CODE<?php header("Content-type: text/vnd.wap.wml"); 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 echo "<head>"; echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" /> <meta http-equiv=\"Cache-Control\" content=\"no-cache\"/> <meta name=\"description\" content=\"Chatheaven ![](http://www.2wap.org/forums/style_emoticons/<#EMO_DIR#>/smile.gif)\"> <meta name=\"keywords\" content=\"free, community, forums, chat, wap, communicate\"></head>"; $bcon = connectdb(); if (!$bcon) { echo "<card id=\"main\" title=\"© Chatheaven (ERROR!)\">"; echo " "; 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 "you can temperoray be in this site <a href=\"http://chatheaven.wen.ru\">$site_name</a> while $site_name is offline "; echo "**THANK YOU VERY MUCH**"; echo " "; echo "</card>"; echo "</wml>"; exit(); } $brws = explode(" ",$_SERVER[HTTP_USER_AGENT] ); $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=\"© Chatheaven (ERROR!)\">"; echo " "; 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 " "; echo " "; echo "UserID: <input name=\"loguid\" format=\"*x\" maxlength=\"30\"/> "; echo "Password: <input type=\"password\" name=\"logpwd\" maxlength=\"30\"/> "; echo "<anchor>"; echo "<go href=\"login.php\" method=\"post\">"; echo "<postfield name=\"loguid\" value=\"$(loguid)\"/>"; echo "<postfield name=\"logpwd\" value=\"$(logpwd)\"/>"; echo "</go> LOGIN "; echo "</anchor>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } } if(($action != "") && ($action!="terms")) { $uid = getuid_sid($sid); if((islogged($sid)==false)||($uid==0)) { echo "<card id=\"main\" title=\"© Chatheaven (ERROR!)\">"; echo " "; echo "You are not logged in "; echo "Or Your session has been expired "; echo "<a href=\"index.php\">Login</a> "; echo " "; echo "</card>"; echo "</wml>"; exit(); } } //echo isbanned($uid); if(isbanned($uid)) { echo "<card id=\"main\" title=\"© Chatheaven (ERROR!)\">"; echo " "; echo "<img src=\"../images/notok.gif\" alt=\"x\"/> "; echo "You are **Banned** "; $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 " "; echo "</card>"; echo "</wml>"; exit(); } $res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'"); ?> <?php //////////////////////////////////gallery List if($action=="gallery") { $who = $_GET["who"]; addonline(getuid_sid($sid),"Viewing Gallery",""); $uid = getuid_sid($sid); //////ALL LISTS SCRIPT << echo "<card id=\"main\" title=\"© Chatheaven \">"; echo " "; if($page=="" || $page<=0)$page=1; if($who!="") { $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM gallery WHERE uid='".$who."'")); }else{ $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM gallery")); } $num_items = $noi[0]; //changable $items_per_page= 5; $num_pages = ceil($num_items/$items_per_page); if(($page>$num_pages)&&$page!=1)$page= $num_pages; $limit_start = ($page-1)*$items_per_page; if($who!="") { $sql = "SELECT id, uid, file FROM gallery WHERE uid='".$who."' ORDER BY id DESC LIMIT $limit_start, $items_per_page"; }else{ $sql = "SELECT id, uid, file FROM gallery ORDER BY id DESC LIMIT $limit_start, $items_per_page"; } $items = mysql_query($sql); echo mysql_error(); if(mysql_num_rows($items)>0) { while ($item = mysql_fetch_array($items)) { $user = getnick_uid($item[1]); $ext = getext($item[2]); $ime = getextimg($ext); $lnk = "<img src=\"gallery.php?id=$item[0]\" alt=\"$user\"/> <a href=\"../gallery/$item[2]\">$user</a>"; if(candelvl($uid, $item[0])) { $delnk = "<a href=\"genproc.php?action=delpic&sid=$sid&vid=$item[0]\">[x]</a>"; }else{ $delnk = ""; } if($who!="") { $byusr=""; }else{ $unick = getnick_uid($item[3]); $ulnk = "<a href=\"index.php?action=viewuser&sid=$sid&who=$item[1]\">$unick</a>"; $byusr = "- By $ulnk"; } echo "$lnk $delnk "; } } echo " "; echo " "; if($page>1) { $ppage = $page-1; echo "<a href=\"pics.php?action=$action&page=$ppage&sid=$sid&who=$who\">«PREV</a> "; } if($page<$num_pages) { $npage = $page+1; echo "<a href=\"pics.php?action=$action&page=$npage&sid=$sid&who=$who\">Next»</a>"; } echo " $page/$num_pages "; if($num_pages>2) { $rets = "Jump to page<input name=\"page\" format=\"*N\" size=\"3\"/>"; $rets .= "<anchor><go href=\"pics.php?action=$action&who=$who&sid=$sid\" method=\"get\">"; $rets .= "</go>GO! "; $rets .= "</anchor>"; echo $rets; } echo " "; ////// UNTILL HERE >> echo " "; echo "<a href=\"upload.php?action=uploader&sid=$sid\">"; echo "Upload Gallery Pictures</a> "; if($who!="") { echo "<a href=\"index.php?action=viewuser&sid=$sid&who=$who\">"; $whonick = getnick_uid($who); echo "$whonick's Profile</a> "; }else{ echo "<a href=\"index.php?action=stats&sid=$sid\">"; echo "<img src=\"../images/stat.gif\" alt=\"*\"/>Site Stats</a> "; } echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>"; echo "Home</a>"; echo " "; echo "</card>"; } echo "</wml>"; ?>

all i did was change the headers .. add in the ?> <wml> <?php bit .. and hopefully converted the forms to wml .. you should cautious with ANY forms that have the ENCTYPE="multipart/form-data" bit in there .. that basically means that it allows files to be sumbitted and as far as i understand, you only need text with that form .. ? anyways .. have fun with that code above .. i have no idea if it works but im fairly certain that the original code you posted wasnt valid so please check the pages using http://validator.w3.org/ !! External image (may be gone)

and if any of that doesnt work, feek free to drop me a msg or two and ill help push you in the right direction =]

oh, and if you didnt already know, for long scripts such as this one, please use the [codebox]...[/codebox] tags instead of ... thanks!

http://3schools.com/wap dunno how you couldn't find that on google

try http://www.w3schools.com/wap .. dunno how you couldnt find that CORRECT url on google ... please ensure your so called 'facts' are correct before you patronise .. thank you.

--Kwah

learner Lead · 587 posts #24

hey kwah bro that is soo cool u r one of the best ppl i had ever come accrossed thank you soo much for this brother in future if u r in any need and if i can help then do ask me brother ill without hesitatin help u. even amylee is a sweet girl to give me tips on wml

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

learner Lead · 587 posts #25

it didn work bro there is some error with

echo "<head>";

echo "<meta http-equiv="Cache-Control" content="must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache"/> <meta name="description" content="Chatheaven "> <meta name="keywords" content="free, community, forums, chat, wap, communicate"></head>";

page dont show External image (may be gone)

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

Guest #29

it didn work bro there is some error with echo "<head>";

echo "<meta http-equiv="Cache-Control" content="must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache"/> <meta name="description" content="Chatheaven "> <meta name="keywords" content="free, community, forums, chat, wap, communicate"></head>";

page dont show External image (may be gone)

look.. you really should go learn programming ..

http://www.w3schools.com/wap/
[url]http://www.w3schools.com/php/[/url]
[url]http://www.w3schools.com/xhtml/[/url]

if it is only that bit which is causing problems, then either take it out or fix it ...

a little bit of homework: try taking a look at the '/' at the end of the meta tags and find out whether it should or shouldnt be there ..

amylee Principal · 1,092 posts #30

i could not amylee i tried alot External image (may be gone)

thats your problem not anyone elses here why should anyone here do any work for you? as kwah just said learn how to code

darkdesire Senior · 250 posts #31

keep trying mate. just think of the personal satisfaction you'll get once you manage it, i myself had no idea how to code anything a year ago and now can do quite fancy stuff, once you get it the first time you'll see exactly how it works and there'll no stopping you. we were all in your position at one time or another, try try try mate... you'll get there in the end... took me 6 months of mistakes before i got anywhere !!

:p:p:p

learner Lead · 587 posts #32

thank you amylee for ur rudeness External image (may be gone) dark desire brother could you alteast instruct me what exactly is wrong and what all do i need to change ill do everythin by myself i just guide me plz and im doin that kwah bro im already goin through ur w3schools wap thanks

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

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