Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]Logowanie - do sprawdzenia :)
Robert
post
Post #1





Grupa: Zarejestrowani
Postów: 117
Pomógł: 0
Dołączył: 2.05.2003

Ostrzeżenie: (0%)
-----


Witam mam taka prosbe......mogl by mi ktos zweryfikowac kod[php:1:ef94c11438]<?php
if(!empty($_POST)) {
if(file_exists('includes/users/'.$_POST['logg'].'.dat')) {
include('includes/users/'.$_POST['logg'].'.dat');
$_POST['passw'] = md5($_POST['passw']) ;
if(isset($log) && isset($pass)) {
if($log == $_POST['logg']) {
if($pass == $_POST['passw']) {
session_start();
session_register("log");
session_register("pass");
header('location: index.php?page=download&'.SID);
exit();
} else {
echo 'Nieprawidlowe haslo!'; }
}
}
}
}

?>
<? if(!empty($_SESSION["log"])){
echo "<table height='68' width='100%' cellpadding='0' cellspacing='0'><tr><td><table width='100%' cellpadding='1' cellspacing='0' style='border-top:1px solid #000000; border-bottom:1px solid #000000'><tr><td align='right' bgcolor='#666666'><font color='#000000'>Witaj <b>".$_SESSION["log"]."</font>&nbsp;</td></tr></table></td></tr><tr><td><table height=100% width='100%' cellpadding='2' cellspacing='0'><tr><td align='center'><font color='#999999'>Jestes zalogowany</font></td></tr><tr><td align='right'>&laquo; <a href='index.php?page=logout' class='admin'>wyloguj</a>&nbsp;</td></tr></table></td></tr></table>";
} else {?>
<table width="100%" cellpadding="1" cellspacing="0"><FORM method="POST" action="<?php echo $PHP_SELF?>">
<tr>
<td colspan="2" height="6"></td>
</tr>
<tr>
<td>&nbsp;Login:</td><td><INPUT type='text' class='login' name='logg'></td>
</tr>
<tr>
<td>&nbsp;Haslo:</td><td><INPUT type="password" class="login" name="passw"> <INPUT type="submit" value="ok"></td></tr>
<tr><td colspan='2'>&nbsp;&raquo; <a href='index.php?page=lost_pass'>Zapomnialem haslo</a></td></tr>
</FORM></table>
<? } ?>[/php:1:ef94c11438]
Tu uzwam session_register, lecz wiem ze gdy sie uzywa $_SESSION to nie mozna tego uzywac......wiec jak by musial wygladac kod by mozna bylo bez problemow stosowac $_SESION......mozliwe ze to moze byc powod nadpisywania mi zmiennej.....
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.12.2025 - 16:36