Код:
<?
if ($userdata['user_active']>0)
{
echo '
<table border="0" style="font-size:12px;" cellpadding="0" cellspacing="0" >
<tr>
<td style="font-size:12px;" height="20"><b>Потребител:</b>
</td>
</tr>
<tr>
<td style="font-size:12px;" height="20"><a
href="'.$phpbb_root_path.'profile.php?mode=viewprofile&u='.$userdata['username'].' ">'. $userdata['username'].'</a>
</td>
</tr>
<tr>
<td height="20" ><a class="user" href="'.$phpbb_root_path.'login.php?logout=true&sid='.$userdata['session_id'].'">Изход</a></td>
</tr>
<tr>
<td height="5">
</td>
</tr>
</table>
';
}
else
{
echo '
<form action="'.$phpbb_root_path.'login.php" method="post" style="margin: 0px;">
<input type="hidden" name="redirect" value="../index.php" />
<table border="0" style="font-size:12px;" width="130" cellspacing="0" cellpadding="0">
<tr>
<td class="left" height="25">
<b>Потребител:</b>
</td>
</tr>
<tr>
<td class="left" height="25">
<input type="text" name="username" size="10" maxlength="25">
</td>
</tr>
<tr>
<td class="left" height="25">
<b>Парола:</b>
</td>
</tr>
<tr>
<td class="left" height="25">
<input type="password" name="password" size="10" maxlength="25">
</td>
</tr>
<tr>
<td>
автоматично: <input type="checkbox" name="autologin" checked >
</td>
</tr>
<tr>
<td class="left" height="35">
<input type="submit" name="login" value="Вход">
</td>
</tr>
<tr>
<td class="left" height="20" >
<a href="'.$phpbb_root_path.'profile.php?mode=register">Регистрация</a>
</td>
</tr>
<tr>
<td class="left" height="20">
<a href="'.$phpbb_root_path.'profile.php?mode=sendpassword" >Забравена парола</a>
</td>
</tr>
</table>
</form>
';
}
?>
Код:
<table width="100%" id="login" border="0" cellspacing="2" cellpadding="2">
<tr>
<td class="menubg">
Вход
</td>
</tr>
<tr>
<td class="menubrd">
<?php
include("conn.php");
$query = sprintf("SELECT * from users WHERE id='%d' AND password = '%s'", $_COOKIE[id], mysql_real_escape_string(htmlspecialchars($_COOKIE[pass])));
$logged = mysql_query($query);
$logged = mysql_fetch_assoc($logged);
if (empty($logged))
{
if (!$_POST[login])
{
$url = $_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'];
echo("
<center>
<form method=\"POST\">
<input type = \"hidden\" name = 'url' value = $url />
<table>
<tr>
<td align=\"left\">
<input type=\"text\" class = 'user' value = 'Потребител' size=\"20\" maxlength=\"25\" name=\"username\">
</td>
</tr>
<tr>
<td align=\"left\">
<input type=\"password\" class = 'pass' value = 'password' size=\"20\" maxlength=\"25\" name=\"password\">
</td>
</tr>
<tr>
</tr>
</table>
</form>
</center>");
}
}
?>
</td>
</tr>
</table>
това са две логин форми
как може да се направи в една ?
тоест искам да ползвам втората !