ВУЗ:
Составители:
Рубрика:
Разработка электронного магазина
на PHP и MySQL
91
include("header.phtml");
print $message;
include("footer.phtml");
}
?>
Личный кабинет (cabinet.phtml)
<?
$title="Личный кабинет";
$color="#aaaaff";
$log=$HTTP_SESSION_VARS["log"];
$id=$HTTP_SESSION_VARS["id"];
if(!isset($log))
{
$success=false;
$message="<tr><td bgcolor='#ff9999' align='center'>
<b>Вы не авторизованы!!!</b></td></tr>";
}
else
$success=true;
include("header.phtml");
print $message;
if($success)
{
include("connect.phtml");
$strSQL="SELECT * FROM customers WHERE id_cust='".$id."'";
$result=mysql_query($strSQL)
or die("Не могу выполнить запрос!");
if($row=mysql_fetch_array($result))
{
?>
<form action=change.phtml method=post>
<tr><td>
<h2>Ваши личные данные</h2>
<table border="0" width="100%" align="right" >
<tr><td align="right"><i>Фамилия: </i></td><td>
<input type=text name=fam value="<?print $row["fam"]?>"></td>
<td align="right"><i>Имя: </i></td><td>
<input type=text name=im value="<?print $row["im"]?>"></td>
</tr>
<tr><td align="right"><i>Адрес: </i></td><td>
<input type=text name=addr value="<?print $row["addr"]?>"></td>
<td align="right"><i>E-mail: </i></td><td>
<input type=text name=mail value="<?print $row["mail"]?>"></td>
</tr>
<tr><td align="right" colspan=3><i>
<input type="checkbox" value="1" name="subscribe"
<? if($row["subscribe"]==1) print "checked"; ?> >
Разработка электронного магазина на PHP и MySQL include("header.phtml"); print $message; include("footer.phtml"); } ?> Личный кабинет (cabinet.phtml) $title="Личный кабинет"; $color="#aaaaff"; $log=$HTTP_SESSION_VARS["log"]; $id=$HTTP_SESSION_VARS["id"]; if(!isset($log)) { $success=false; $message=""; } else $success=true; include("header.phtml"); print $message; if($success) { include("connect.phtml"); $strSQL="SELECT * FROM customers WHERE id_cust='".$id."'"; $result=mysql_query($strSQL) or die("Не могу выполнить запрос!"); if($row=mysql_fetch_array($result)) { ?> Вы не авторизованы!!!