Ragazzi come potrei organizzare questa pagina in xhtml?

Codice PHP:
<?php
$rand 
rand(0100000);
include 
"./ini.php";
//авторизаци�
$login autorize();
header ("Content-type:text/vnd.wap.wml; charset=utf-8");
print 
'<?xml version="1.0" encoding="utf-8"?>'.
'<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">'.
'<wml>'.
'<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>'.
'<card title="'.$login['title'].'">'.
'

[size="1"]'
;
//
if($login) {
if(
$action)
{
$query = @mysql_query("select `msg` from `".$px.$mtable."` where login='$name'");
$dbmsg = @mysql_fetch_array($query);
$error="";
$name=trim($name);
$msg=trim($msg);
    if(
$msg == $dbmsg['msg'])
    {
    
$action="";
    
$error=$error."[b]comment not added[/b]
"
;
    }
    if(empty(
$msg))
    {
    
$action="";
    
$error=$error."[b]nickname not added[/b]
"
;
    }
    if(empty(
$name))
    {
    
$action="";
    
$error=$error."[b]email not added[/b]
"
;
    }
if(!empty(
$email))
{
    if(!
preg_match("/[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}/i"$email))
    {
    
$action="";
    
$error=$error."[b]error4[/b]
"
;    
    }
}
$name=substr($name,0,50);
$name=htmlspecialchars(stripslashes($name));
$msg=substr($msg,0,100);
$msg=htmlspecialchars(stripslashes($msg));
$exsoft=explode(" ",getenv(HTTP_USER_AGENT));
$soft=$exsoft[0];
if(empty(
$error))
{
//
@mysql_query("insert into `".$px.$mtable."` values(0,'".$name."','".$msg."','".$email."','".$url."','".$login['login']."','".time()."','$soft');");
print 
"[/size]</p></card><card id=\"added\" title=\"MESSAGE ADDED\" ontimer=\"wapgb.php?login=".$login['login']."&amp;r=$rand\"><timer value=\"10\"/>

[size="
1"]<a href=\"wapgb.php?login=".$login['login']."&amp;r=$rand\">[to gbook]</a>
<img src=\"http://hifi-project.net/rating/count.php?id=4\" alt=\"w@p rating\"/>"
;
}
else
print 
"[/size]</p></card><card id=\"added\" title=\"test3\" ontimer=\"wapgb.php?login=".$login['login']."&amp;r=$rand\"><timer value=\"30\"/>

[size="
1"]you do not post nothing !!!
$error<a href=\"wapgb.php?login=".$login['login']."&amp;r=$rand\">[to gbook]</a>
<img src=\"http://hifi-project.net/rating/count.php?id=4\" alt=\"w@p rating\"/>
"
;
} else {
$q = @mysql_query("select `login`,`msg`,`time`,`email`,`url`,`soft` from `".$px.$mtable."` where `user`='".$login['login']."' order by `time` desc;");
while(
$mdata = @mysql_fetch_array($q)) {
$name[] = $mdata['login'];
$msg[] = $mdata['msg'];
$time[] = $mdata['time'];
$email[] = $mdata['email'];
$url[] = $mdata['url'];
$softs[] = $mdata['soft'];
}
$i=count($name);
$count=$i;
$count1=$count;
if(empty(
$start))
$start=0;
$start=intval($start);
if(
$start<0)
$start=0;
if(
$count>$start+8$count=$start+8;
print 
'°[url="wapgb.php?login='.$login['login'].'&amp;r='.$rand.'"]refresh[/url]
'
;
print 
' [url="#add"]write[/url]
'
;
if(
$start!=0)
print 
'«[url="wapgb.php?login='.$login['login'].'&amp;start='.($start-8).'"]back[/url]
'
;
if(
$count1>$start+8)
print 
'»[url="wapgb.php?login='.$login['login'].'&amp;start='.($start+8).'"]next[/url]
'
;
for(
$i=$start;$i<$count;$i++)
{
print 
"<img src=\"http://hifi-project.net/gbook/gbook.gif\" alt=\"logo\"/>
"
;
print 
'[b]NICK: [/b]<anchor>'.$name[$i].'<go href="./wapgb.php?login='.$login['login'].'#add" method="post"><postfield name="who" value="'.$name[$i].',"/></go></anchor>
'
;
print 
"[b]TIME: [/b]";
print 
date("H.i"$time[$i])."
"
;
print 
"[b]DATE: [/b]";
print 
date("d.m.Y"$time[$i])."
"
;
print 
"[b]NET: [/b]";
print 
"".$softs[$i]."
"
;
print 
"[b]MSG: [/b]";
print 
$msg[$i].'
'
;
print 
"[b]MAIL: [/b]";
print 
$email[$i].'
'
;
print 
"[b]SITE: [/b]";
print 
"<a href=\"".$url[$i]."\">".$url[$i]."</a>
"
;
print 
"----------
"
;
}
print 
"«<a href=\"".$login['link']."\">HOME</a>
"
;
print 
'»[url="./regform.php"]GET YOURS[/url]

»[url="./enter.php"]MANAGE GBOOK[/url]
----------
'
.
'[url="http://hifi-project.net/rating/?cid=4"][img]http://hifi-project.net/rating/count.php?id=4[/img][/url][/size]</p></card>'.
'<card id="add" title="ADD COMMENT">

[size="1"]'
;
print 
"<a href=\"http://\">*ADVERTISING*</a>
NICKNAME:[/size]
"
.
"<input type=\"text\" name=\"nik\" maxlength=\"32\" value=\"$(nik)\"/>
"
.
"[size="1"]COMMENT:[/size]
"
.
"<input type=\"text\" name=\"msg$rand\" value=\"".$who."\"/>
"
.
"[size="1"]E-MAIL:[/size]
"
.
"<input type=\"text\" name=\"email\" value=\"$(email)\"/>
"
.
"[size="1"]SITE URL:[/size]
"
.
"<input type=\"text\" name=\"url\" value=\"http://\"/>
"
.
"[size="1"]<anchor>[send]<go href=\"wapgb.php?login=".$login['login']."&amp;action=add#added\" method=\"post\">".
"<postfield name=\"name\" value=\"$(nik)\"/>".
"<postfield name=\"msg\" value=\"$(msg$rand)\"/>".
"<postfield name=\"email\" value=\"$(email)\"/>".
"<postfield name=\"url\" value=\"$(url)\"/>".
"</go></anchor>";}
} else print 
"[b]test[/b]
"
;
print 
'[/size]</p></card></wml>';
?>
Grazie dell'aiutoooo