File size: 7.09Kb
<?php
$act=$HTTP_POST_VARS['act'];
$premail=$HTTP_POST_VARS['premail'];
$prpass1=$HTTP_POST_VARS['prpass1'];
$prpass2=$HTTP_POST_VARS['prpass2'];
$avatar=$HTTP_POST_VARS['avatar'];
require "inc.php";
$myid=$_COOKIE["usid"];
$mypass=$_COOKIE["pass"];
$db=mysql_connect($dbhost, $dbuser, $dbpass);
mysql_select_db($dbname,$db);
if (!isset($myid)) $myid=1;
if (!isset($mypass)) $mypass=0;
$sqlc="select * from users where usid=$myid";
$c=mysql_query($sqlc);
$resc=mysql_fetch_array($c);
if (($resc[pass]==$mypass)&&($myid!=0))
{
if ((!isset($act))||($premail==""))
{
echo"
<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
<head>
<title></title>
<meta name=\"description\" content=\"\">
<meta name=\"keywords\" content=\"\">
</head>
<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#006699\" vlink=\"#006699\" alink=\"#006699\">
<STYLE type=\"text/css\">
A {text-decoration: none;}
body
{
margin-left: 1%;
margin-right: 1%;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
background-color: #F0F0F0;
}
</STYLE>";
include "top.php";
echo"
<form method=\"post\" action=\"profile.php\">
<FONT size=2 color=\"#000000\" face=\"Arial\">
<TABLE width=100% border=1 cellpadding=1 bordercolor=\"#222288\" cellspacing=0>
<TR valign=top>
<TD>
<FONT size=2 color=\"#000000\" face=\"Arial\">
<DIV>
<TABLE width=100% bgcolor=\"#FFFFFF\" border=0 cellpadding=5 bordercolor=\"#000000\" cellspacing=0>
<TR valign=top>
<TD colspan=\"4\" bgcolor=\"#8B93A0\">
<FONT size=2 color=\"#000000\" face=\"Arial\">
<DIV align=\"center\"><strong>Profile</strong></DIV>
</FONT>
</TD>
</TR>
<TR valign=top>
<TD height=16 bgcolor=\"#D5DAEA\"> </TD>
<TD height=16 bgcolor=\"#D5DAEA\"><FONT size=2 color=\"#000000\" face=\"Arial\"><strong>E-Mail</strong></FONT></TD>
<TD height=16 bgcolor=\"#D5DAEA\"><div align=\"justify\"><input name=\"premail\" type=\"text\" size=\"70\" maxlength=\"50\" value=\"$resc[email]\"></div></TD>
<TD height=16 bgcolor=\"#D5DAEA\"> </TD>
</TR>
<TR valign=top>
<TD height=16 bgcolor=\"#D5DAEA\"> </TD>
<TD height=16 bgcolor=\"#D5DAEA\"><FONT size=2 color=\"#000000\" face=\"Arial\"><strong>New password</strong></FONT></TD>
<TD height=16 bgcolor=\"#D5DAEA\"><div align=\"justify\"><input name=\"prpass1\" type=\"password\" size=\"70\" maxlength=\"50\" value=\"\"></div></TD>
<TD height=16 bgcolor=\"#D5DAEA\"> </TD>
</TR>
<TR valign=top>
<TD height=16 bgcolor=\"#D5DAEA\"> </TD>
<TD height=16 bgcolor=\"#D5DAEA\"><FONT size=2 color=\"#000000\" face=\"Arial\"><strong>Confirm password</strong></FONT></TD>
<TD height=16 bgcolor=\"#D5DAEA\"><div align=\"justify\"><input name=\"prpass2\" type=\"password\" size=\"70\" maxlength=\"50\" value=\"\"></div></TD>
<TD height=16 bgcolor=\"#D5DAEA\"> </TD>
</TR>
<TR valign=top>
<TD height=16 bgcolor=\"#D5DAEA\"> </TD>
<TD height=16 bgcolor=\"#D5DAEA\"><FONT size=2 color=\"#000000\" face=\"Arial\"><strong>Picture</strong></FONT></TD>
<TD height=16 bgcolor=\"#D5DAEA\">
<table width=\"100%\" border=\"0\">
<tr>
<td><input name=\"avatar\" type=\"radio\" value=\"0\" ";if ($resc[avatar]=="av0.gif") echo "checked"; echo"><img src=\"img/av0.gif\"></td>
<td><input name=\"avatar\" type=\"radio\" value=\"1\" ";if ($resc[avatar]=="av1.gif") echo "checked"; echo"><img src=\"img/av1.gif\"></td>
<td><input name=\"avatar\" type=\"radio\" value=\"2\" ";if ($resc[avatar]=="av2.gif") echo "checked"; echo"><img src=\"img/av2.gif\"></td>
<td><input name=\"avatar\" type=\"radio\" value=\"3\" ";if ($resc[avatar]=="av3.gif") echo "checked"; echo"><img src=\"img/av3.gif\"></td>
</tr>
<tr>
<td><input name=\"avatar\" type=\"radio\" value=\"4\" ";if ($resc[avatar]=="av4.gif") echo "checked"; echo"><img src=\"img/av4.gif\"></td>
<td><input name=\"avatar\" type=\"radio\" value=\"5\" ";if ($resc[avatar]=="av5.gif") echo "checked"; echo"><img src=\"img/av5.gif\"></td>
<td><input name=\"avatar\" type=\"radio\" value=\"6\" ";if ($resc[avatar]=="av6.gif") echo "checked"; echo"><img src=\"img/av6.gif\"></td>
<td><input name=\"avatar\" type=\"radio\" value=\"7\" ";if ($resc[avatar]=="av7.gif") echo "checked"; echo"><img src=\"img/av7.gif\"></td>
</tr>
<tr>
<td><input name=\"avatar\" type=\"radio\" value=\"8\" ";if ($resc[avatar]=="av8.gif") echo "checked"; echo"><img src=\"img/av8.gif\"></td>
<td><input name=\"avatar\" type=\"radio\" value=\"9\" ";if ($resc[avatar]=="av9.gif") echo "checked"; echo"><img src=\"img/av9.gif\"></td>
<td><input name=\"avatar\" type=\"radio\" value=\"10\" ";if ($resc[avatar]=="av10.gif") echo "checked"; echo"><img src=\"img/av10.gif\"></td>
<td><input name=\"avatar\" type=\"radio\" value=\"11\" ";if ($resc[avatar]=="av11.gif") echo "checked"; echo"><img src=\"img/av11.gif\"></td>
</tr>
</table>
</TD>
<TD height=16 bgcolor=\"#D5DAEA\"> </TD>
</TR>
<TR valign=top>
<TD width=\"10%\" height=16 bgcolor=\"#D5DAEA\"></TD>
<TD width=\"15%\" height=16 bgcolor=\"#D5DAEA\"></TD>
<TD width=\"65%\" height=16 bgcolor=\"#D5DAEA\">
<div align=\"justify\">
<font color=\"#000000\" size=\"2\" face=\"Arial\">
<input type=\"submit\" name=\"Submit\" value=\" OK \">
<a href=\"index.php\"><input type=\"button\" name=\"cancel\" value=\"Cancel\"></a>
<input type=\"hidden\" name=\"act\" value=\"post\">
</font>
</div>
</TD>
<TD width=\"10%\" height=16 bgcolor=\"#D5DAEA\"></TD>
</TR>
</table>
</div>
</font>
</td>
</tr>
</TABLE>
</FONT>
</form>";
include "bottom.php";
echo"
</body>
</html>";
}else
{
if (($prpass1==$prpass2)&&($prpass1!=""))
{
$pass=md5($prpass1);
$sqlp="update users set pass='$pass' where usid='$resc[usid]'";
$a=mysql_query($sqlp);
setcookie("pass",$pass);
}
if ($avatar==0) $av="av0.gif"; else
if ($avatar==1) $av="av1.gif"; else
if ($avatar==2) $av="av2.gif"; else
if ($avatar==3) $av="av3.gif"; else
if ($avatar==4) $av="av4.gif"; else
if ($avatar==5) $av="av5.gif"; else
if ($avatar==6) $av="av6.gif"; else
if ($avatar==7) $av="av7.gif"; else
if ($avatar==8) $av="av8.gif"; else
if ($avatar==9) $av="av9.gif"; else
if ($avatar==10) $av="av10.gif"; else
if ($avatar==11) $av="av11.gif";
$sqlp="update users set avatar='$av' where usid='$resc[usid]'";
$a=mysql_query($sqlp);
$premail=htmlspecialchars($premail, ENT_QUOTES);
$sqlp="update users set email='$premail' where usid='$resc[usid]'";
$a=mysql_query($sqlp);
Header("Location: index.php");
}
}
?>