Can anyone help me convert this script in xhtml...
CODE<?php $rand = rand(0, 100000); 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'].'">'. '
';
//
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."Mesajul nu a fost adaugat!
";
}
if(empty($msg))
{
$action="";
$error=$error."Numele nu a fost adaugat!
";
}
if(empty($name))
{
$action="";
$error=$error."E-mail nu a fost adaugat!
";
}
if(!empty($email))
{
if(!preg_match("/[0-9a-z_]+@[0-9a-z_^.]+.[a-z]{2,3}/i", $email))
{
$action="";
$error=$error."error4
";
}
}
$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 "
</card><card id="added" title="MESSAGE ADDED" ontimer="wapgb.php?login=".$login['login']."&r=$rand"><timer value="10"/>
<a href="wapgb.php?login=".$login['login']."&r=$rand">Guestbook</a> "; } else print " </card><card id="added" title="test3" ontimer="wapgb.php?login=".$login['login']."&r=$rand"><timer value="30"/>
Nu ai postat nimic !!!
$error<a href="wapgb.php?login=".$login['login']."&r=$rand">Guestbook</a>
";
} 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 '.'&r='.$rand.'"]1.Reincarca
';
print '2.Scrie
';
if($start!=0)
print '«.'&start='.($start-8).'"]inapoi
';
if($count1>$start+8)
print '».'&start='.($start+8).'"]inainte
';
for($i=$start;$i<$count;$i++)
{
print "----------
";
print 'Nume:<anchor>'.$name[$i].'<go href="./wapgb.php?login='.$login['login'].'#add" method="post"><postfield name="who" value="'.$name[$i].',"/></go></anchor>
';
print "Ora:";
print date("H.i", $time[$i])."
";
print "Data:";
print date("d.m.Y", $time[$i])."
";
print "Browser:";
print "".$softs[$i]."
";
print "Mesaj:";
print $msg[$i].'
';
print "E-mail:";
print $email[$i].'
';
print "Site:";
print "<a href="".$url[$i]."">".$url[$i]."</a>
";
print "----------
";
}
print "<a href="".$login['link']."">3.Acasa</a>
";
print '4.Inregistrare
5.Autentificare
'. 'External image (may be gone) </card>'. '<card id="add" title="Adauga Mesaj">
'; print "<a href="http://stylemaster.wen.ru/jocuri.wml">1.3 Free Games</a> Nume: ". "<input type="text" name="nik" maxlength="32" value="$(nik)"/> ". "Mesaj: ". "<input type="text" name="msg$rand" value="".$who.""/> ". "E-mail: ". "<input type="text" name="email" value="$(email)"/> ". "Adresa site: ". "<input type="text" name="url" value="http://"/> ". "<anchor>1.Trimite<go href="wapgb.php?login=".$login['login']."&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 "http://stylemaster.wen.ru "; print ' </card></wml>'; ?>
CODE<?php
//заголовок
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>';
//включаем файл конфигурации
include "./ini.php";
//обрабатываем полученные данные
$login=htmlspecialchars(stripslashes(trim($login)));
$pass=htmlspecialchars(stripslashes(trim($pass)));
$title=htmlspecialchars(stripslashes(trim($title)));
$link=htmlspecialchars(stripslashes(trim($link)));
//вывод Ñ�траницы в браузер
print '<card title="Реги��траци��">'.
'
';
//запро�� в базу данных
$query_users_login = @mysql_query("select * from ".$px.$utable." where login='".$login."';");
$users_login = @mysql_fetch_array($query_users_login);
///провер��ем нужные пол��, запи��ываем ошибки в переменную
if(empty($login)) $error='Ð�е введен логин!
';
if(empty($pass)) $error=$error.'Ð�е введен пароль!
';
if(empty($title)) $error=$error.'Ð�е введен заголовок!
';
if(empty($link)) $error=$error.'Ð�е введен адре�� Ñ�айта!
';
if(preg_match("/[^\da-zA-Z_]+/",$login)) $error.='В логине обнаружены недопу��тимые Ñ�имволы! Логин должен быть на латинице!
';
if(preg_match("/[^\da-zA-Z_]+/",$pass)) $error.='Ð�едопу��тимые Ñ�имволы в пароле! Пароль должен быть на латинице!
';
///////////////////////////////////
$db_login = $users_login['login'];
//е��ли ошибок нет
if(empty($error))
{//е��ли логин и пароль пу��ты
//е��ли введенный логин не равен логину в базе, то:
if(strtolower($login) != strtolower($db_login))
{
//запро�� на реги��трацию пользовател��
@mysql_query("insert into ".$px.$utable." values(0,'$login','$pass','".$title."','$link');");
print $login.", Ñ�па��ибо за реги��трацию го��тевой!
";
print '<anchor>Вход<go href="wapgb.php" method="post">
<postfield name="login" value="$(login)"/>
</go>
</anchor>';
}
else
{
print 'К Ñ�ожалению такой пользователь уже зареги��трирован!';
}
}
else
{//выводим ошибки
print $error;
}
print '
</card></wml>';
//разрываем Ñ�оединение Ñ� бд
@mysql_close();
?>
CODE<?php //по��ылаем заголовки header ("Content-type:text/vnd.wap.wml; charset=utf-8"); //вывод в браузер print "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; print '<!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>'; // include "./ini.php"; // $login = enter(); // print '<card title="UPDATE PROFILE">'. '
';
if($login) {
if(empty($action)) {
print 'LOGIN AS: '.$login['login'].'
'.
'NEW PASSWORD:
'.
'<input type="text" name="newpass" value="'.$login['pass'].'"/>
'.
'NEW TITLE:
'.
'<input type="text" name="title" value="'.$login['title'].'"/>
'.
'NEW LINK:
'.
'<input type="text" name="link" value="'.$login['link'].'"/>
'.
'<anchor>[update]<go href="profile.php?login='.$login['login'].'&pass=$pass" method="post">'.
'<postfield name="action" value="edit"/>'.
'<postfield name="newpass" value="$(newpass)"/>'.
'<postfield name="title" value="$(title)"/>'.
'<postfield name="link" value="$(link)"/>'.
'</go></anchor>
';
//
}
else
{
//
if(@mysql_query("update ".$px.$utable." set pass='$newpass',title='".$title."',link='$link' where login='".$login['login']."';"))
print "YOUR NEW PROFILE WAS UPDATE IT !!!
";
//;
print "<a href="../index.php">[home]</a>";
}
if(!$action)
print "<anchor>[home]<prev/></anchor>
";
} else { print ""; }
//
print '
'.
'</card>'.
'</wml>';
//
@mysql_close();
?>