Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> problem z odświerzaniem
Apo
post 23.10.2005, 14:13:07
Post #1





Grupa: Zarejestrowani
Postów: 426
Pomógł: 1
Dołączył: 2.10.2005

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


Mam skrypt logowanie oparty na sesjach oto kod:
  1. <?php 
  2. error_reporting(E_ALL ^ E_NOTICE); 
  3. @header("Cache-control: private"); 
  4.  
  5. if(isset($_GET['panel'])) 
  6. { 
  7.  
  8. $ip = $_SERVER[REMOTE_ADDR]; 
  9. $data = date("d.m.Y, G:i:s"); 
  10.  
  11.  $uchwyt = @fopen($logi_db, "r"); 
  12.  $tempCon = @fread($uchwyt, filesize($logi_db)+1); 
  13.  @fclose($uchwyt); 
  14.  
  15. $hand = @fopen($logi_db, "w"); 
  16. @flock($hand, LOCK_EX); 
  17. @fwrite($hand, $ip.'<>'.$data."n"); 
  18. @fwrite($hand, $tempCon); 
  19. @flock($hand, LOCK_UN); 
  20. @fclose($hand); 
  21.  
  22.  if(!isset($_SESSION['auth'])) 
  23.  { 
  24.  $_SESSION['auth'] = 0; 
  25.  } 
  26.  else { 
  27.  if($_SESSION['auth'] == 1 && $_SESSION['user'] == $log && $_SESSION['pass'] == $pass) 
  28.  { 
  29.  header('Location: '.$url.'panel.php'); 
  30.  } 
  31.  
  32.  else { 
  33.  if(!empty($login) && !empty($haslo)) 
  34.  { 
  35.  if($login == $log && $haslo == $pass) 
  36.  { 
  37.  $_SESSION['auth'] = 1; 
  38.  $_SESSION['user'] = $login; 
  39.  $_SESSION['pass'] = $haslo; 
  40.  } 
  41.  } 
  42.  else { 
  43.  ?> 
  44. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
  45. <html xmlns="http://www.w3.org/1999/xhtml"> 
  46. <head> 
  47. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" /> 
  48. <link rel="alternate" type="application/rss+xml" title="RSS" href="date/rss.php" /> 
  49. <link rel="stylesheet" type="text/css" href="style.css" /> 
  50. <title><?php echo $title; ?></title> 
  51. </head> 
  52. <body xml:lang="pl"> 
  53.  
  54. <form action="" method="post"> 
  55. <input type="text" name="login" /><br /> 
  56. <input type="text" name="haslo" /><br /> 
  57. <input type="submit" value="loguj" /> 
  58. </form> 
  59.  
  60. </body> 
  61. </html> 
  62. <?php 
  63.  } 
  64.  } 
  65. } 
  66. } 
  67. ?>


I teraz mam taki problem:
jak wpisze adres: www.strona.pl/index.php?panel to nie odrazu pojawi mi sie strona z formularzem do logowania tyklo musze kliknąć odświerz aby sie pokazał, to samo sie dzieje po poprawnym wypełnieniu formularza gdy nacisne loguj znowu musze dać odświerz aby zobaczeć panel administracyjny, dlaczego tak sie dzieje sad.gif
Go to the top of the page
+Quote Post
mdco
post 24.10.2005, 19:41:26
Post #2





Grupa: Zarejestrowani
Postów: 324
Pomógł: 5
Dołączył: 14.12.2004

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


Mnie pomogło na samym początku skryptu:
  1. <?php
  2.  
  3. session_cache_limiter("must-revalidate"); 
  4.  
  5. ?>


--------------------
zmoderowano - rozmiar
Go to the top of the page
+Quote Post
Apo
post 24.10.2005, 20:10:49
Post #3





Grupa: Zarejestrowani
Postów: 426
Pomógł: 1
Dołączył: 2.10.2005

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


hmm mi to nie pomogło :/
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 Wersja Lo-Fi Aktualny czas: 13.06.2025 - 03:49