Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]problem z odczytem sesji
emeres1
post
Post #1





Grupa: Zarejestrowani
Postów: 72
Pomógł: 0
Dołączył: 28.03.2010

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


Witam,
coś robię źle ponieważ sesja zarejestrowana w funkcji login() jest niewidoczna w funkcji OnlinerControl().Podpowie ktoś gdzie robię błąd?
  1. public function login()
  2. {
  3. if(empty($_GET['logpanel'])){
  4. include_once ('view/formloger.php5');
  5. }
  6. elseif($_GET['logpanel']="action"){
  7.  
  8. $resulter=$this->model->login_model($this->user,$this->pass_login);
  9. echo"controler.$resulter";
  10. if($resulter=='1'){
  11. include_once('view/log_succes.php5');
  12. $_SESSION["logged"]= $this->user;
  13. if(!empty($_SESSION['logged'])) {
  14. echo"jest";
  15. }
  16. }elseif($resulter=='2'){
  17.  
  18. include_once('view/log_wrongpl.php5');
  19. }
  20.  
  21.  
  22. }
  23. }

  1. public function OnlinerControl(){
  2. $user_session= $_SESSION['logged'];
  3. echo "br";
  4. echo $user_session;
  5. echo "<br>";
  6. if(!empty($user_session)){
  7. $oncon = $this->onliner->OnlinerAction($user_session);
  8. }
  9.  
  10. }
Go to the top of the page
+Quote Post
kadlub
post
Post #2





Grupa: Zarejestrowani
Postów: 548
Pomógł: 105
Dołączył: 4.06.2010

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


sprawdź czy masz session_start()
  1. $_SESSION["logged"]

i spróbuj zamiast " dać '
  1. $_SESSION['logged']
Go to the top of the page
+Quote Post
emeres1
post
Post #3





Grupa: Zarejestrowani
Postów: 72
Pomógł: 0
Dołączył: 28.03.2010

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


zmieniłem i niestety dalej to samo.
co do session start():
  1. <?php
  2. include_once("controller/controller.php5");
  3.  
  4.  
  5. $obj= new Controller();
  6. $obj->login();
  7. $obj->logout();
  8. $obj->OnlinerControl();
  9.  
  10. $obj1=new UploadControl();
  11. $obj1->uploadcontroller();
  12.  
  13.  
  14. ?>


pomoże ktoś?
Go to the top of the page
+Quote Post

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 Aktualny czas: 22.08.2025 - 01:54