Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php]cookies w logowniu[php]
martino277
post 2.09.2007, 10:34:07
Post #1





Grupa: Zarejestrowani
Postów: 86
Pomógł: 0
Dołączył: 23.11.2006

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


siemaka all exclamation.gif! jestem poczatkujacy w php ktos by mi pomogl dodadac cookies do tego logowania albo podpowiedziec jak tpo zrobic
  1. <div align="center" id="photo">
  2. <?php
  3.  
  4. defined('VALID_ACCESS') or exit();
  5.  
  6.  
  7. if(isset($_POST['login']))
  8. {
  9. if($_POST['login'] == '')
  10. {
  11. echo "<script>alert('".LAN_EMPTY_LOGIN."'); window.history.go(-1);</script>";
  12. exit();
  13. }
  14. if($_POST['password'] == '')
  15. {
  16. echo "<script>alert('".LAN_EMPTY_PASSWORD."'); window.history.go(-1);</script>";
  17. exit();
  18. }
  19. if($User->login($_POST['login'], $_POST['password']))
  20. {
  21. $_SESSION['loged'] = 1;
  22. $_SESSION['user_id'] = $User->id;
  23. $_SESSION['type'] = $User->type;
  24. $_SESSION['user_login'] = $User->login;
  25. $Core->move_to('index.php');
  26. } else
  27. {
  28. echo '<p class="error">'.LAN_WRONG_LOGIN.'</p>';
  29. }
  30.  
  31. }
  32. if(!isset($_POST['login']) && !isset($_SESSION['loged']))
  33. {
  34. echo '
  35. <div align="center" id="photo">
  36. <form action="'.$_SERVER['PHP_SELF'].'?task=login" method="post">
  37. <p class="information">
  38. '.LAN_LOGIN.'<br />
  39. <input type="text" value="" name="login" /><br /><br />
  40.  
  41. '.LAN_PASSWORD.'<br />
  42. <input type="password" value="" name="password" /><br /><br /> 
  43. <input type="submit" value="ok" />
  44. </p>
  45. </form>
  46. </div>
  47. ';
  48. }
  49. ?>
  50. </div>

za pomomoc z gory dziekuje pozdrawiam

Ten post edytował martino277 2.09.2007, 12:10:11
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 29.06.2025 - 04:30