Location: PHPKode > projects > Modular Site Manager > htdocs/misc/edit-profile.php
<?
chdir("../");

include "inc/functions.inc.php";
echo "<base href=\"".SITE_URL."\" />";
$mysql = new mysql(DB_MAIN);

$uid = $_COOKIE['mid'];

$email = $_POST['email'];

$aim = $_POST['aim'];

$msn = $_POST['msn'];

$yahoo = $_POST['yahoo'];

$icq = $_POST['icq'];

$sig = cut($_POST['sig'], SIG_LENGTH, "");

$sel = $mysql->select(PRE."members", "username='".$_COOKIE['user']."'", "id", "DESC", "1");
$a = mysql_fetch_array($sel);

if($a['avatar'] !== "noava.gif" && !empty($_FILES['avatar']['name']))
{
		unlink("./avatars/".$a['avatar']);
}

if(!empty($_FILES['avatar']['name']))
{
	
	$asd = explode(".", $_FILES['avatar']['name']);
		
	move_uploaded_file($_FILES['avatar']['tmp_name'], TEMP.$_FILES['avatar']['name']);
	
	resizeava(TEMP.$_FILES['avatar']['name'], SITE_PATH."avatars/".$_COOKIE['user'].".".$asd[1]);
	
	$avaname = $_COOKIE['user'].".".$asd[1];
	
	unlink(TEMP.$_FILES['avatar']['name']);
} else {
	if($a['avatar'] !== "noava.gif")
	{
		$avaname = $a['avatar'];
	} else {
		$avaname = "noava.gif";
	}
}

if(!$mysql->update(PRE."members", "aim='".$aim."', msn='".$msn."', icq='".$icq."', yahoo='".$yahoo."', email='".$email."', signature='".$sig."', avatar='".$avaname."', pglimit='".$_POST['pglimit']."', wpid='".(int)$_POST['wpid']."'", "id='".$uid."'"))
{
	die("Couldn't update your profile");
} else {
	//header("Location: ".$HTTP_REFERER);
	pleasewait("profile");
}
$mysql->close();
unset($mysql); 
?>
Return current item: Modular Site Manager