HTML/PHP/AJAX/JS - Wylogowywanie i Logowanie
pittero - 30-12-2008, 11:43 Temat postu: Wylogowywanie i Logowanie Jak zrobic na odzielnej stronie tzn w cmsie dwa przyciski zeby nas np wylogowalo i zalogowalo?
Tzn jak jestem niezalogowany to przycisk zaloguj a jak sie zalogowalem to przycisku zaloguj nie ma a jest przycisk Wyloguj?
maminowiec - 30-12-2008, 17:45
Kod: | <?php
define('IN_PHPBB', true);
$phpbb_root_path = './'; // sciezka do forum
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
$userdata = session_pagestart($user_ip, PAGE_INDEX, $session_length);
init_userprefs($userdata);
?>
<?php
if( $userdata['session_logged_in'] )
{
echo '<center><b>Witaj '.$userdata['username'].'</b></center><br>';
}
else
{
echo '<center>
<form method="post" action="login.php" STYLE="display: inline" name="login">
<input width="100" height="16" type="text" name="username">
<input width="100" height="16" type="password" name="password">
<input type="hidden" name="redirect" value="../">
<input type=hidden name=login value="login">
<input class="text" type="checkbox" name="autologin">Zamiętaj mnie<br>
<input width="53" height="14" type="submit" value="Zaloguj">
</form>';
echo '<A HREF="'.append_sid($phpbb_root_path.'profile.php?mode=register').'" class=l>Rejestracja</a>';
echo '<A HREF="'.append_sid($phpbb_root_path.'profile.php?mode=sendpassword').'" class=l>Zapomniałem hasło</a>';
}
?> |
|
|
|