Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Unknown error
Lethys
post
Post #1





Grupa: Zarejestrowani
Postów: 642
Pomógł: 2
Dołączył: 9.03.2006

Ostrzeżenie: (30%)
XX---


Co prawda skrypt chodzi dobrze ale wyskakuje blad :

Cytat
Warning: Unknown(): Your script possibly relies on a session side-effect which existed until php 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0



A oto kod :

  1. <?php
  2. case 3:$file="login.php";
  3.  if(isset($username))
  4.  {
  5.  $sql="select password,active,subscribed from members where username='$username'";
  6. $result=mysql_query($sql);
  7. while($row=mysql_fetch_array($result))
  8. {
  9. $dbpass=$row[0];
  10. $active=$row[1];
  11. $subscribed=$row[2];
  12. }
  13. if($dbpass==$password)
  14. {
  15.  if($active==2)
  16.  {
  17.  $error="wu";
  18. $file="login.php";
  19.  }
  20.  else if($active==0) 
  21.  {
  22.  $file="validcode.php";
  23.  }
  24.  else
  25.  {
  26. $ses_username=$username;
  27. if($subscribed=="")$subscribed="N";
  28. session_register("ses_username");
  29. session_register("subscribed");
  30. if(empty($repusername)&&empty($rphid))
  31. {
  32. $username="";
  33. $file="myphotos.php";
  34. }
  35. else if(!empty($repusername))
  36. {
  37. $username=$repusername;
  38. $file="sendmessage.php";
  39. }
  40. else if(!empty($rphid))
  41. {
  42. $phid=$rphid;
  43. $file="postcomment.php";
  44. }
  45. }
  46. }
  47. else
  48. {
  49. $error="wu";
  50. $file="login.php";
  51. }
  52.  }  
  53. break;
  54. ?>



Moze mi ktos pomoc ? (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
cadavre
post
Post #2





Grupa: Zarejestrowani
Postów: 472
Pomógł: 7
Dołączył: 7.12.2005
Skąd: Gliwice

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


Może użycie http://pl2.php.net/manual/pl/function.session-register.php powoduje error?

Definiuj zmienne sesyjne po prostu poprzez $_SESSION. Poza tym sesję możesz rozpocząć już na samym początku kodu, a nawet powinieneś by nie zgubić po drodze danych z sesji.

Ten post edytował cadavre 16.12.2006, 00:06:12
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: 13.10.2025 - 06:11