Advertisement
rav1989

Untitled

Apr 25th, 2011
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.57 KB | None | 0 0
  1. <?php
  2. try
  3. {
  4.     require('../class/sesja.php');
  5.  
  6.     if($session -> getUser() -> isAnonymous())
  7.     {
  8.         header('Location: ./index.php');
  9.         exit;
  10.     }
  11.     else
  12.     {
  13.         echo '<p>Witaj, '.$session -> getUser() -> getNazwa().'!
  14.             (<a href="./login.php?action=logout">Wyloguj sie</a>)</p>';
  15.     }
  16.    
  17.     $session -> getUser() -> opis = 'Jakis tam opis ten jest nudny';
  18.    
  19.     echo $session -> getUser() -> getOpis();
  20.  
  21.     if($session -> getUser() -> isAdmin())
  22.     {
  23.         echo '<br> To zobaczy admin.';
  24.     }
  25. }
  26. catch(PDOException $exception)
  27. {
  28.     echo 'Blad bazy danych: '.$exception->getMessage();
  29. }
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement