Wml And Xhtml In One Page

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

18 replies · 1,153 views · started 19 years ago · 1 min read

3 participants
subzero Super moderator Fellow · 3,954 posts #2
if ($force=="wml")
{
$head = "text/vnd.wap.wml";  //used for debugging
$mime = ((stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) ? "application/xhtml+xml" : "text/vnd.wap.wml");
}else{
    $mime = $force;
}
$uid = getuid_nick($uname);
$charset = "utf-8";
header("content-type:$mime;charset=$charset");
if($mime=="application/xhtml+xml")
{
echo("<?xml version=\"1.0\"?>\n");
    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
}else{
    echo("<?xml version=\"1.0\"?>\n");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
}
if ($force=="xhtml")
{
$header = "";  //used for debugging
$mime = ((stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) ? "application/xhtml+xml" : "text/vnd.wap.wml");
}else{
    $mime = $force;
}
$uid = getuid_nick($uname);
$charset = "utf-8";
if($mime=="application/xhtml+xml")
{
echo("\n");
    echo "\n";
}else{
    echo("\n");
echo "\n";
}
//show mean page
    

if($mime== MIME_TYPE)
    {
        
        
        echo header($uname."@lavalair.net",$pstyle);

               what ever you need here        

        echo "</p>";
        echo foot();
    }else{

echo "<a href=" url .php?action=main&sid=$sid&force=wml or xhtml">Index</a>"; change what you need in xhtml

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #4

that how they do it at same time action + force they both work as a team lol i had done this

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

wizard Senior · 493 posts #5

mmhm http://wap.funmobile.ws

<?php

include("config.php");
include("core.php");

if($mime== WEB)
{
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>";

    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";
}else{
    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\">";
}
$bcon = connectdb();
if (!$bcon)
{
echo dberror();
}
$uid = getuid_ses($ses);
if($act!="") {
if((islogged($ses)==false)||($uid==0))
    {
        $msg = "You Are Not Logged In Or Your Session Has Expired!";

    if($mime== WEB)
    {
        echo xhtmlhead(ERROR);
        echo $msg;
        echo xhtmlfoot();
        exit();
    }else{
        echo wmlhead(ERROR);
        echo "

";
        echo $msg;
        echo "</p>";
        echo wmlfoot();
        exit();
    }
    }
}

$res = mysql_query("UPDATE wiz_users SET browser='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_ses($ses)."'");

if($act=="")
{
    if($mime== WEB)
    {
    echo xhtmlhead($pgtitle);
        echo "<div class=\"center\">";
        echo "<img src=\"images/logo.gif\" alt=\"$stitle\"/>";
echo "
";
echo "
";
echo "Welcome to $pgtitle";
echo "
";
echo "The Best WAP Community";

        echo "</div>";
        echo "<form action=\"login.php\" method=\"get\">";
        echo "Username:";
        echo "
";
        echo "<input type=\"text\" name=\"$unm\" maxlength=\"15\" />";
        echo "
";
        echo "Password:";
        echo "
";
        echo "<input type=\"password\" name=\"$pwd\" maxlength=\"15\" />";
        echo "
";
        echo "<input type=\"hidden\" name=\"svw\" value=\"$svw\"/>";
        echo "<input type=\"submit\" value=\"login\" />";
        echo "</form>";
        echo "
";
        echo "
";
        echo "Not Yet a Member?";
        echo "
";
        echo "<a href=\"register.php?svw=$svw\">»Register</a>";
        echo "<div class=\"center\">";
        echo "<a href=\"index.php?svw=w\">WML Version</a>";
        echo "
";
        echo "
";
        echo "© Wizard 2007";
        echo "</div>";
    echo xhtmlfoot();
    }else{
    echo wmlhead($pgtitle);
        echo "<p align=\"center\">";
        echo "<img src=\"images/logo.gif\" alt=\"$stitle\"/>";
echo "
";
echo "
";
echo "Welcome to $pgtitle";
echo "
";
echo "The Best WAP Community";

        echo "</p>";
        echo "

";
        echo "Username:";
        echo "
";
        echo "<input type=\"text\" name=\"unm\" maxlength=\"15\" />";
        echo "
";
        echo "Password:";
        echo "
";
        echo "<input type=\"password\" name=\"pwd\" maxlength=\"15\" />";
        echo "
";
        echo "<anchor>login<go href=\"login.php\" method=\"get\">";
        echo "<postfield name=\"unm\" value=\"$(unm)\"/>";
        echo "<postfield name=\"pwd\" value=\"$(pwd)\"/>";
        echo "<postfield name=\"svw\" value=\"$svw\"/>";
        echo "</go>";
        echo "</anchor>";
        echo "
";
        echo "
";
        echo "Not Yet a Member?";
        echo "
";
        echo "<a href=\"register.php?svw=$svw\">»Register</a>";
        echo "</p>";
        echo "<p align=\"center\">";
        echo "<a href=\"index.php?svw=x\">XHTML Version</a>";
        echo "
";
        echo "
";
        echo "© Wizard 2007";
        echo "</p>";
    echo wmlfoot();
    }
}else if($act=="main")
{

 addonline(getuid_ses($ses),"Portal Index","index.php?act=$act");

    if($mime== WEB)
    {
    echo xhtmlhead($pgtitle);
        echo "<div class=\"center\">";
        echo "<img src=\"images/logo.gif\" alt=\"$stitle\"/>";
        echo "</div>";

        echo "<div class=\"center\">";
        echo "<a href=\"index.php?act=main&ses=$ses&svw=w\">WML Version</a>";
        echo "
";
        echo "
";
        echo "© Wizard 2007";
        echo "</div>";
    echo xhtmlfoot();
    }else{
    echo wmlhead($pgtitle);
        echo "<p align=\"center\">";
        echo "<img src=\"images/logo.gif\" alt=\"$stitle\"/>";
        echo "</p>";

        echo "<p align=\"center\">";
        echo "<a href=\"index.php?act=main&ses=$ses&svw=x\">XHTML Version</a>";
        echo "
";
        echo "
";
        echo "© Wizard 2007";
        echo "</p>";
    echo wmlfoot();
    }

}

?>
subzero Super moderator Fellow · 3,954 posts #6

Yes you have now got the idea External image (may be gone) lol

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #8

yes ppl will love to get there hand on that bro also as i say pmpl lazy fookers really bro

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

subzero Super moderator Fellow · 3,954 posts #10

make sure before put copyright by you and a url to main page echo ""; on all body heads so they see External image (may be gone)

Visit: Chat4u.mobi - The New Lay Of being a site of your dreams! Visit: WapMasterz Coming Back Soon!


SCRIPTS FOR SALE BY SUBZERO Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders. FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others... _______…

thanatos Senior · 261 posts #12

what do i need to put in core? shall i make a new php page?

wizard Senior · 493 posts #13

here is an example

core.php

<?php define ('WAP','text/vnd.wap.wml'); define ('WEB','application/xhtml+xml'); $view = $_GET["view"]; $force = ""; //$force = "text/vnd.wap.wml"; //used for debugging if ($force=="") { $mime = ((stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) ? "application/xhtml+xml" : "text/vnd.wap.wml"); }else{ $mime = $force; } $charset = "utf-8"; header("content-type:$mime;charset=$charset"); function waphead($pgtitle) { $ret = "<wml><card id=\"main\" title=\"$pgtitle\">"; return $ret; } function wapfoot() { $ret = "</card></wml>"; return $ret; } function webhead($pgtitle) { $ret = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" >"; $ret .= "<head>"; $ret .= "<title>$pgtitle</title>"; $ret .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/theme.css\" />"; $ret .= "</head><body>"; return $ret; } function webfoot() { $ret = "</body></html>"; return $ret; }
wizard Senior · 493 posts #14

here is an example

core.php

<?php
define ('WAP','text/vnd.wap.wml');
define ('WEB','application/xhtml+xml');
$view = $_GET["view"];

$force = "";
//$force = "text/vnd.wap.wml";  //used for debugging
if ($force=="")
{
$mime = ((stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) ? "application/xhtml+xml" : "text/vnd.wap.wml");
}else{
    $mime = $force;
}

$charset = "utf-8";
header("content-type:$mime;charset=$charset");

function waphead($pgtitle)
{
    $ret = "<wml><card id=\"main\" title=\"$pgtitle\">";
    return $ret;
}
function wapfoot()
{
    $ret = "</card></wml>";
    return $ret;
}
function webhead($pgtitle)
{
    $ret = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" >";
    $ret .= "<head>";
    $ret .= "<title>$pgtitle</title>";
    $ret .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/theme.css\" />";
    $ret .= "</head><body>";
    return $ret;
}
function webfoot()
{
    $ret = "</body></html>";
    return $ret;
}
thanatos Senior · 261 posts #15

shall i put this in core(wml) or core(xhtml)? what about the details in one page?

wizard Senior · 493 posts #16

index.php

<?php
include("core.php");

if($mime== WEB)
{
echo("<?xml version=\"1.0\"?>\n");
    echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
}else{
    echo("<?xml version=\"1.0\"?>\n");
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">\n";
}

if($mime== WEB) {

echo webhead($pgtitle);
echo "

";
echo "<a href=\"index.php?view=w\">WML</a>";
echo "</p>";
echo webfoot();
}else{
echo waphead($pgtitle);
echo "

";
echo "<a href=\"index.php?view=x\">XHTML VIEW</a>";
echo "</p>";
echo wapfoot();

}
?>
wizard Senior · 493 posts #17

core.php

<?php

define ('WAP','text/vnd.wap.wml');
define ('WEB','application/xhtml+xml');

$view = $_GET["view"];

if($view=="w")
{
$mime = "text/vnd.wap.wml"; 
}else if($view=="x")
{
$mime = "application/xhtml+xml"; 
}else if($view=="")
{

$force = "";
//$force = "text/vnd.wap.wml";  //used for debugging
if ($force=="")
{
$mime = ((stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) ? "application/xhtml+xml" : "text/vnd.wap.wml");
}else{
    $mime = $force;
}
}

$charset = "utf-8";
header("content-type:$mime;charset=$charset");

function waphead($pgtitle)
{
    $ret = "<wml><card id=\"main\" title=\"$pgtitle\">";
    return $ret;
}
function wapfoot()
{
    $ret = "</card></wml>";
    return $ret;
}
function webhead($pgtitle)
{
    $ret = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" >";
    $ret .= "<head>";
    $ret .= "<title>$pgtitle</title>";
    $ret .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"style/theme.css\" />";
    $ret .= "</head><body>";
    return $ret;
}
function webfoot()
{
    $ret = "</body></html>";
    return $ret;
}

do not put that in ur script just upload those two pages

linkrx7 #19

this is how i did my wml ans xhtml together for my gallery

else if($action=="gallery") { $script = $_GET["script"]; addonline(getuid_sid($sid),"Viewing Gallery",""); if($script=="wml"){ echo "<card id="main" title="Gallery Pics">"; echo " "; echo "<img src="../images/logo.gif" alt=""/> "; echo "Gallery Pics "; }else{ echo "<head>"; echo "<title>Gallery Pics</title>"; echo "<link rel="stylesheet" type="text/css" href="../themes/$theme[0]">"; echo "</head>"; echo "<body>"; echo ""; echo "<img src="../images/logo.gif" alt=""/> "; echo "Gallery Pics"; } echo "<img src="../images/point.gif" alt="!"/>If ur browser cannot use the uploader email ur pics to afta_drk@hotmail.com dnt 4get 2 include ur username"; echo " <img src="../images/banner.gif" alt=""/> "; if(!($dp = opendir("./"))) die ("Cannot open ./"); $file_array = array(); while ($file = readdir ($dp)) { if(substr($file,0,1) != '.' and $file != "index.php") { $file_array[] = $file; } } $file_count = count ($file_array); sort ($file_array); echo "<a href="index.php?action=pics&sid=$sid&script=$script">Gallery Pics</a>($file_count) "; if(!($dp = opendir("../pics_adult"))) die ("Cannot open ./"); $file_array = array(); while ($file = readdir ($dp)) { if(substr($file,0,1) != '.' and $file != "index.php") { $file_array[] = $file; } } $file_count = count ($file_array); sort ($file_array); echo "<a href="../pics_adult/index.php?action=pics&type=adult&sid=$sid&script=$script">Adult Pics</a>($file_count) ";

echo "<img src="../images/banner.gif" alt=""/> "; echo " "; if($script=="wml"){ echo "<a href="../wap/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo " "; echo "</card>"; }else{ echo "0<a accesskey="0" href="../web/index.php?action=main&sid=$sid"><img src="../images/home.gif" alt=""/>Home</a>"; echo ""; echo "</body>"; } }

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