Location: PHPKode > projects > Simple But Mighty Blog > sbmb03/profile.php
<?

//Simple But Mighty Blog, version 0.3.1
//copyright © 2007, Mighty Mind
// @license http://opensource.org/licenses/gpl-license.php GNU Public License
// Äàííàÿ ïðîãðàììà ÿâëÿåòñÿ ñâîáîäíûì ïðîãðàììíûì îáåñïå÷åíèåì. Âû âïðàâå ðàñïðîñòðàíÿòü åå è/èëè ìîäèôèöèðîâàòü â ñîîòâåòñòâèè ñ
//óñëîâèÿìè âåðñèè 3 Ñòàíäàðòíîé Îáùåñòâåííîé Ëèöåíçèè GNU, îïóáëèêîâàííîé Free Software Foundation. 
// Ìû ðàñïðîñòðàíÿåì äàííóþ ïðîãðàììó â íàäåæäå íà òî, ÷òî îíà áóäåò âàì ïîëåçíîé, îäíàêî ÍÅ ÏÐÅÄÎÑÒÀÂËßÅÌ ÍÀ ÍÅÅ ÍÈÊÀÊÈÕ ÃÀÐÀÍÒÈÉ,
//â òîì ÷èñëå ÃÀÐÀÍÒÈÈ ÒÎÂÀÐÍÎÃÎ ÑÎÑÒÎßÍÈß ÏÐÈ ÏÐÎÄÀÆÅ è ÏÐÈÃÎÄÍÎÑÒÈ ÄËß ÈÑÏÎËÜÇÎÂÀÍÈß Â ÊÎÍÊÐÅÒÍÛÕ ÖÅËßÕ.
//Äëÿ ïîëó÷åíèÿ áîëåå ïîäðîáíîé èíôîðìàöèè îçíàêîìüòåñü ñî Ñòàíäàðòíîé Îáùåñòâåííîé Ëèöåíçèåé GNU.
//Âìåñòå ñ äàííîé ïðîãðàììîé âû äîëæíû áûëè ïîëó÷èòü ýêçåìïëÿð Ñòàíäàðòíîé Îáùåñòâåííîé Ëèöåíçèè GNU.
//Åñëè âû åãî íå ïîëó÷èëè, ñîîáùèòå îá ýòîì â Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//

session_start();
include ("config.php");
include ("functions.php");
get_headers_list();

if ((isset($_SESSION["id"])) and ($_SESSION["id"]!=0) and (getstatus($_SESSION["id"],check_string($_SERVER["REMOTE_ADDR"]))>1) )
{
$id=$_SESSION["id"];
if (!empty($_FILES['userfile']['name'])) {
$uploaddir="images/";
$uploadfile=md5(date("YmdHis")).".jpg";
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploaddir.$uploadfile)) {
	@$result=mysql_query("SELECT image FROM `$t_users` WHERE id=$id") or die("<p>Îøèáêà ïîèñêà â ÁÄ!</p>");
	$row=mysql_fetch_array($result);
	@unlink("images/".$row["image"]);
	@$result=mysql_query("UPDATE `$t_users` SET image='$uploadfile' WHERE id=$id") or die("<p>Îøèáêà äîáàâëåíèÿ â ÁÄ!</p>");
	} else {echo "Ôàéë íå çàãðóæåí.";}
}
if (isset($_POST["email"])){
$email=check_email($_POST["email"]);
@$result=mysql_query("UPDATE `$t_users` SET email='$email' WHERE id=$id") or die("<p>Îøèáêà äîáàâëåíèÿ â ÁÄ!</p>");
}
if (isset($_POST["styleurl"])){
$styleurl=check_string($_POST["styleurl"]);
@$result=mysql_query("UPDATE `$t_users` SET style='$styleurl' WHERE id=$id") or die("<p>Îøèáêà äîáàâëåíèÿ â ÁÄ!</p>");
$_SESSION["style"]=$styleurl;
}
Header("Location: ".$_SERVER["HTTP_REFERER"]);
}
Header("Location: ".$_SERVER["HTTP_REFERER"]);
if (isset($_SESSION["topic"])) {
Header("Location: index.php?topic=".$_SESSION["topic"]);
?>
<br>Íàæìèòå <a href=index.php?topic=<? echo $_SESSION["topic"];?>>çäåñü</a> äëÿ ïåðåõîäà â áëîã...
<?
} else {
Header("Location: index.php");
?>
<br>Íàæìèòå <a href=index.php>çäåñü</a> äëÿ ïåðåõîäà â áëîã...
<?
}
Return current item: Simple But Mighty Blog