Goodbye Wml Hello Xhtml

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

21 replies · 1,367 views · started 19 years ago · 1 min read

4 participants
SpiderWap Lead · 622 posts #2

Ok, i need help here, im not to sure on converting this page it's still in anchor but im not to sure how it must look in xhtml cause anchor links change into txt when converting them...

CODE<?php

include('config.php'); echo("<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\n"); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" > <head> <title>SpiderWap.Co.Za ™ </title> <link rev="made" href="mailto:quintin@spiderwap.co.za" /> <link rev="start" href="spiderwap.co.za/." title="Home Page" /> <link rel="StyleSheet" type="text/css" href="style/style.css" /> <link rel="shortcut icon" type="image/x-icon" href="logo.gif" /> <meta http-equiv="Cache-Control" content="must-revalidate" /> <meta http-equiv="Cache-Control" content="no-cache" /> <meta name="description" content="chat forum new downloads swop shop top.spiderwap banner rating fun games mxit guestbook services " /> <meta name="keywords" content="Best South African wapsite ever" /> </head> <body> <? echo "<wml>";

////////////REGISTER////////////

if ($go=="") {

echo "<card id="reg" title="L.O.W. top"> "; echo "Submit Site

";

echo "Site Name:* "; echo "<input type="text" name="name" maxlength="30"/> "; echo "Password:* "; echo "<input type="text" name="pass" maxlength="10"/> "; echo "Email:* "; echo "<input type="text" name="mail" maxlength="100"/> "; echo "Link* "; echo "<input type="text" name="link" value="http://" maxlength="100"/> "; echo "Logo link "; echo "<input type="text" name="logo" value="http://" maxlength="100"/> "; echo "Site Description:* "; echo "<input type="text" name="desc" maxlength="200"/> "; echo "Catagory:* ";

echo "<select name="cat">"; echo "<option value="1">$category1</option>"; echo "<option value="2">$category2</option>"; echo "<option value="3">$category3</option>"; echo "<option value="4">$category4</option>"; echo "<option value="5">$category5</option>"; echo "<option value="6">$category6</option>"; echo "<option value="7">$category7</option>"; echo "<option value="8">$category8</option>"; echo "<option value="9">$category9</option>"; echo "<option value="10">$category10</option>"; echo "<option value="11">$category11</option>"; echo "</select> ";

echo "<anchor>[ Submit ]"; echo "<go href="$PHP_SELF?go=1" method="post">"; echo "<postfield name="name" value="$(name)"/>"; echo "<postfield name="pass" value="$(pass)"/>"; echo "<postfield name="mail" value="$(mail)"/>"; echo "<postfield name="link" value="$(link)"/>"; echo "<postfield name="logo" value="$(logo)"/>"; echo "<postfield name="cat" value="$(cat)"/>"; echo "<postfield name="desc" value="$(desc)"/>"; echo "</go></anchor> ";

echo "<a href="index.php?LOW=top">[ Main ]</a> "; echo "----

"; echo "© spiderwap.co.za

</card></wml>"; }

////////////REGISTRATION STATUS////////////

if ($go=="1") {

echo "<card id="reg_status" title="L.O.W. top"> "; if($name!="" and $pass!="" and $mail!="" and $link!="" and $desc!="" ){ $name = STRTOLOWER($name); $pass = STRTOLOWER($pass); $mail = STRTOLOWER($mail); $date = DATE("Y,m,d,h,i,s"); $lastout = DATE("Y,m,d,h,i,s"); $lastin = DATE("Y,m,d,h,i,s");

        $name=str_replace(" "," ",$name);
        $name=str_replace("$","",$name);
        $name=str_replace("&lt;"," &lt; ",$name);
        $name=str_replace("<"," &lt; ",$name);
        $name=str_replace(">"," &gt; ",$name);
        $name=str_replace("&gt;"," &gt; ",$name);
        $name=str_replace("\"","",$name);
        $name=str_replace("'","",$name);
        $name=str_replace("\\","",$name);
        $name=str_replace("&"," &amp; ",$name);
        $name=str_replace("£","",$name);
        $name=str_replace("Â","",$name);
        $name=trim($name);

        $pass=str_replace(" "," ",$pass);
        $pass=str_replace("$"," $$ ",$pass);
        $pass=str_replace("&lt;"," &lt; ",$pass);
        $pass=str_replace("<"," &lt; ",$pass);
        $pass=str_replace(">"," &gt; ",$pass);
        $pass=str_replace("&gt;"," &gt; ",$pass);
        $pass=str_replace("\"","",$pass);
        $pass=str_replace("'","",$pass);
        $pass=str_replace("\\","",$pass);
        $pass=str_replace("&"," &amp; ",$pass);
        $pass=str_replace("£"," GBP ",$pass);
        $pass=trim($pass);

        $mail=str_replace(" ","",$mail);
        $mail=str_replace("$","",$mail);
        $mail=str_replace("&lt;","",$mail);
        $mail=str_replace("<","",$mail);
        $mail=str_replace(">","",$mail);
        $mail=str_replace("&gt;","",$mail);
        $mail=str_replace("\"","",$mail);
        $mail=str_replace("'","",$mail);
        $mail=str_replace("\\","",$mail);
        $mail=str_replace("&","",$mail);
        $mail=trim($mail);

        $link=str_replace(" "," ",$link);
        $link=str_replace("$"," $$ ",$link);
        $link=str_replace("&lt;"," &lt; ",$link);
        $link=str_replace("<"," &lt; ",$link);
        $link=str_replace(">"," &gt; ",$link);
        $link=str_replace("&gt;"," &gt; ",$link);
        $link=str_replace("'","",$link);
        $link=str_replace("&"," &amp; ",$link);
        $link=str_replace("£"," GBP ",$link);
        $link=trim($link);

        $logo=str_replace(" "," ",$logo);
        $logo=str_replace("$"," $$ ",$logo);
        $logo=str_replace("&lt;"," &lt; ",$logo);
        $logo=str_replace("<"," &lt; ",$logo);
        $logo=str_replace(">"," &gt; ",$logo);
        $logo=str_replace("&gt;"," &gt; ",$logo);
        $logo=str_replace("'","",$logo);
        $logo=str_replace("&"," &amp; ",$logo);
        $logo=str_replace("£"," GBP ",$logo);
        $logo=trim($logo);

        $desc=str_replace(" "," ",$desc);
        $desc=str_replace("$"," $$ ",$desc);
        $desc=str_replace("&lt;"," &lt; ",$desc);
        $desc=str_replace("<"," &lt; ",$desc);
        $desc=str_replace(">"," &gt; ",$desc);
        $desc=str_replace("&gt;"," &gt; ",$desc);
        $desc=str_replace("\"","",$desc);
        $desc=str_replace("'","",$desc);
        $desc=str_replace("\\","",$desc);
        $desc=str_replace("&"," &amp; ",$desc);
        $desc=str_replace("£"," GBP ",$desc);
        $desc=trim($desc);

$query= ("INSERT INTO landofwap_toplist ( id, name , pass, date , lastout, lastin, mail, link, logo, cat, description ) values('','$name','$pass','$date', '$lastout', '$lastin', '$mail','$link','$logo','$cat', '$desc' );");

$result = mysql_query($query); if(!$result){print"Site Name already exists or you have not filled in every section. Please try again. <a href="$PHP_SELF">Back</a>

<a href="index.php">Main Menu</a> "; }

else{ $getid = mysql_query("SELECT * FROM landofwap_toplist where name = '$name' "); while($get = mysql_fetch_array($getid)){ $id = $get['id']; $sendto = $get['mail']; $subject = "Toplist link\n";
$message = "toplist, $mymail\n\nRegistration successful!\nplease place a link from your site to:\n$yoursite?id=$id\n"; mail($sendto, $subject, $message); }

print"Registration Successful!

please place a link from your site to:

".$yoursite."?id=".$id." to increase your rating.

This link has also been emailed to: ".$sendto."

<a href="index.php">Main Menu</a> ";
echo "© spiderwap.co.za

</card></wml>"; } } }

?>

wizard Senior · 493 posts #3
echo "<form action=\"$PHP_SELF?go=1\" method=\"post\">";
echo "[size="1"]Site Name:*[/size]
";
echo "<input type=\"text\" name=\"name\" maxlength=\"30\"/>
";
echo "[size="1"]Password:*[/size]
";
echo "<input type=\"text\" name=\"pass\" maxlength=\"10\"/>
";
echo "[size="1"]Email:*[/size]
";
echo "<input type=\"text\" name=\"mail\" maxlength=\"100\"/>
";
echo "[size="1"]Link*[/size]
";
echo "<input type=\"text\" name=\"link\" value=\"http://\" maxlength=\"100\"/>
";
echo "[size="1"]Logo link[/size]
";
echo "<input type=\"text\" name=\"logo\" value=\"http://\" maxlength=\"100\"/>
";
echo "[size="1"]Site Description:*[/size]
";
echo "<input type=\"text\" name=\"desc\" maxlength=\"200\"/>
";
echo "[size="1"]Catagory:*[/size]
";

echo "<select name=\"cat\">";
echo "<option value=\"1\">$category1</option>";
echo "<option value=\"2\">$category2</option>";
echo "<option value=\"3\">$category3</option>";
echo "<option value=\"4\">$category4</option>";
echo "<option value=\"5\">$category5</option>";
echo "<option value=\"6\">$category6</option>";
echo "<option value=\"7\">$category7</option>";
echo "<option value=\"8\">$category8</option>";
echo "<option value=\"9\">$category9</option>";
echo "<option value=\"10\">$category10</option>";
echo "<option value=\"11\">$category11</option>";
echo "</select>
";

echo "<input type=\"submit\" value=\"register\"/>";

echo "</form>
";
SpiderWap Lead · 622 posts #6

ATLAST MY GREATEST WORK IS COMPLETED!!!!!!!!! WOOOHOOO!!!!!! XHTML RULEZ!!!!!! THANX FOR THAT INFO WIZZARD, I SAW WHAT YOU'VE DONE THERE, ILL FOLLOW THAT EXAMPLE IN MY NEXT SCRIPTS, IT LOOKS EXCELENT http://top.spiderwap.co.za Wizzard give me your email addy ill send you a copy for helping me, and clint is the origonal guy of the script, if someone has his email addy plz give it to me, wana give him a copy aswell.

Guest #9

nice shitt

linkrx7 #10

its best to hav wml as well as xhtml as older wap1 mobile browsers dnt support xhtml redirecting them is easy jus use the http_accept

linkrx7 #12

use this code

<?php

global $userBrowser;

// Your wapsite

$wmllink = "wap/index.php";

// Your website

$htmllink = "web/index.php";

//Detect the browser
$userBrowser = $_SERVER['HTTP_USER_AGENT']; 

//echo $userBrowser;

if(strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.XHTML+XML") > 0)
{
  $ub="PC";
}
else if(strpos(strtoupper($HTTP_ACCEPT),"XHTML+XML") > 0)
{
  $ub="PC";
}
else
{
  $ub="WML";
  }
if($ub == "PC") {
    header("Location: ".$htmllink);
    exit;
    }
    else 
    {
    header("Location: ".$wmllink);
    exit;
    }    
?>
alesh Lead · 604 posts #13

hmmmm okay i got no problem with converting my site 2 xhtml (only problem is the tome lol) STILL I HAVE A QUESTION

I WANNA LET THE USERS CHOSE THE THEME THEY WANT BUT I DNT KNW HOW.........................

A READ SUM LAVA XHTML AND I FOUND THIS IN EVERY FILE

echo "<link rel="StyleSheet" type="text/css" href="style/style.css" />"; AND FOLDER "style" with sum style.css document.......

yeah with tht fille i cn md5 colors of entire script but WHAT I HAVE 2 DO THT USERS CHOSE THEME THEY LIKE?????

I MEAN, I KNW I HAVE 2 MAKE LINK AT C PANEL ETC, BUT DNT KNW HOW T CONECT WITH ALOTS OF THEME......

SUM LIL EXPLANATION PLS??????

eeeeerrr....

wizard Senior · 493 posts #14

hmmmm okay i got no problem with converting my site 2 xhtml (only problem is the tome lol) STILL I HAVE A QUESTION

I WANNA LET THE USERS CHOSE THE THEME THEY WANT BUT I DNT KNW HOW.........................

A READ SUM LAVA XHTML AND I FOUND THIS IN EVERY FILE

echo "<link rel="StyleSheet" type="text/css" href="style/style.css" />"; AND FOLDER "style" with sum style.css document.......

yeah with tht fille i cn md5 colors of entire script but WHAT I HAVE 2 DO THT USERS CHOSE THEME THEY LIKE?????

I MEAN, I KNW I HAVE 2 MAKE LINK AT C PANEL ETC, BUT DNT KNW HOW T CONECT WITH ALOTS OF THEME......

SUM LIL EXPLANATION PLS??????

check this script ere, http://wizardwap.net/script.zip

alesh Lead · 604 posts #15

oh so i have 2 make another table at user database and then another just 4 themes???????

also....

then i dnt need this echo "<link rel="StyleSheet" type="text/css" href="style/style.css" />"; and i cn get rid of this????

and then i need 2 put this code at evry file

$getuthm = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE name='".$uid."' AND pass='".$upw."'")); $uth = $getuthm[0];

if($getuthm[0]!="") { $uthm = "$uth"; $uthm = utheme($uthm); }else{ $uthm = "default.css"; }

AM I RIGHT?????

eeeeerrr....

wizard Senior · 493 posts #16

oh so i have 2 make another table at user database and then another just 4 themes???????

also....

then i dnt need this echo "<link rel="StyleSheet" type="text/css" href="style/style.css" />"; and i cn get rid of this???? and then i need 2 put this code at evry file

$getuthm = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE name='".$uid."' AND pass='".$upw."'")); $uth = $getuthm[0];

if($getuthm[0]!="") { $uthm = "$uth"; $uthm = utheme($uthm); }else{ $uthm = "default.css"; } AM I RIGHT?????

not that simple

alesh Lead · 604 posts #17

yeah i knw.... evrythng with database is not simple 4 me...... lol ill try it anyway....

eeeeerrr....

Guest #18
$getuthm = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE name='".$uid."' AND pass='".$upw."'"));

if($getuthm[0]==""){
  $uthm = "default.css";
}else{
  $uthm = $getuthm[0];
}

    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"styles/$uthm\" />";

that's untested but i see no reason why it wouldnt work if you place this code in the <head>...</head> section (where the other stylesheet code is) and you adjust the href="styles... to suit your own directory structure

you woud also need to setup the database to include 'theme' in the 'ibwf_users' table SELECT theme FROM ibwf_users

just get back to me if any of this doesnt make sense or something isnt working etc .. if im not around on wapforum,org.uk you might be better contacting me at kwah90@gmail.com


if you are using the lavalair script, you might also want to try this one instead:

$uid = getuid_sid($sid);
$getuthm = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$uid."'"));

if($getuthm[0]==""){
  $uthm = "default.css";
}else{
  $uthm = $getuthm[0];
}

    echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"styles/$uthm\" />";
alesh Lead · 604 posts #19

thank u...yes im using lava script... nd i thought its boring if i just make it in 1 color... cuz more ppl, more taste, right...?

i understand wht u said, but i have 2 try it 1st... 2 c if i understood it corectly..... thanx

eeeeerrr....

Guest #20

thank u...yes im using lava script... nd i thought its boring if i just make it in 1 color... cuz more ppl, more taste, right...?

i understand wht u said, but i have 2 try it 1st... 2 c if i understood it corectly..... thanx

let me know if it works =]

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