<?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";
mysql_query ("select * from bannedib WHERE ci='$ci' AND (ip = '".getenv(REMOTE_ADDR)."')and(browser = '".getenv(HTTP_USER_AGENT)."')");
                        if(mysql_affected_rows()!=0){include "b.php";}
$login = autorize();
// Title
print '<card title="ProFile">'.
'<p align="center">';
// if empty
if(empty($id))
print "You Are Nt Login !<br/>";
if($login) {
if(empty($action)) {
print 'Name:<br/>'.
'<input type="text" name="name" value="'.$login['name'].'"/><br/>'.
'New password:<br/>'.
'<input type="text" name="newpass" value="'.$login['pass'].'"/><br/>'.
'Sex:<br/>'.
'<select name="sex" title="sex" value="'.$login['sex'].'">'.
'<option value="m">M</option>'.
'<option value="zh">F</option></select><br/>'.
'Pic Avatar:<br/>'.
'<select name="pic" title="pic" value="'.$login['pic'].'">'.
'<option value="1">1</option>'.
'<option value="2">2</option>'.
'<option value="3">3</option></select><br/>'.
'Date Of Birth:<br/>'.
'<input size="2" name="bday" maxlength="2" value="'.$login['bday'].'" format="*N"/>-<input size="2" name="bmonth" maxlength="2" value="'.$login['bmonth'].'" format="*N"/>-<input size="4" name="byear" maxlength="4" value="'.$login['byear'].'" format="*N"/><br/>'.
'Location:<br/>'.
'<input type="text" name="live" value="'.$login['live'].'"/><br/>'.
'Mobile type:<br/>'.
'<input type="text" name="mobile" value="'.$login['mobile'].'"/><br/>'.
'e-mail:<br/>'.
'<input type="text" name="email" value="'.$login['email'].'"/><br/>'.
'WAP-site:<br/>'.
'<input type="text" name="wapurl" value="'.$login['wapsite'].'"/><br/>'.
'About yourself:<br/>'.
'<input type="text" name="about" value="'.$login['about'].'"/><br/>'.
'<anchor>change<go href="profile.php?ci='.$ci.'&amp;id='.$id.'&amp;pass='.$pass.'" method="post">'.
'<postfield name="action" value="edit"/>'.
'<postfield name="name" value="$(name)"/>'.
'<postfield name="newpass" value="$(newpass)"/>'.
'<postfield name="sex" value="$(sex)"/>'.
'<postfield name="pic" value="$(pic)"/>'.
'<postfield name="bday" value="$(bday)"/>'.
'<postfield name="bmonth" value="$(bmonth)"/>'.
'<postfield name="byear" value="$(byear)"/>'.
'<postfield name="live" value="$(live)"/>'.
'<postfield name="mobile" value="$(mobile)"/>'.
'<postfield name="email" value="$(email)"/>'.
'<postfield name="wapurl" value="$(wapurl)"/>'.


'<postfield name="about" value="$(about)"/></go></anchor><br/>';
// about
}
else
{
// Update
if(@mysql_query("update `".$px.$utable."` set name='$name',pass='$newpass',sex='$sex',pic='$pic',bday='$bday',bmonth='$bmonth',byear='$byear',live='$live',mobile='$mobile',email='$email',wapsite='$wapurl',about='$about'  where id='$id' and ci='$ci';"))
print "<b>Sucessfully  changed!</b><br/>";
// Hall
print "<a href=\"enter.php?ci=$ci&amp;id=$id&amp;pass=$newpass\">Hall</a>";
}
if(!$action)
print "<anchor>Back<prev/></anchor><br/>";
} else { print "Nt Back !"; }
// End 
print '</p>'.
'</card>'.
'</wml>';
// end of script
@mysql_close();
?>
