Problema PHP

Despre PHP, MySQL, HTML, C++, VB, JAVA etc.

Moderator: Moderatori

Post Reply
cornuletz
Posts: 10
Joined: Tue Jul 15, 2003 12:02 pm

Problema PHP

Post by cornuletz »

Am o problema cu modul in care functioneaza sau mai bine zis nu functioneaza sesiunile la mine in computer atunci cand rulez urmatorul script:

Code: Select all

<?php
session_start();
 $HTTP_SESSION_VARS['a']="yyy";

 echo  $HTTP_SESSION_VARS['a'];
?>
<a href="3.php">click</a>
si 3.php

Code: Select all

<?php
session_start();
echo $HTTP_SESSION_VARS['a'];

?>
Atunci cand dau click pe link-ul de pe prima pagina trece la "3.php" dar nu se intampla nimic. Ce pot sa fac?
User avatar
The Beast
Posts: 2487
Joined: Wed Jun 04, 2003 11:45 am

Post by The Beast »

ca sa iti returneze ceva cred ca scripturile trebuie sa fie pe un server, nu la tine pe comp, ca sa stie ce sa returneze!
(iertatati-ma daca am zis cea mai mare prostie din viata mea)
cornuletz
Posts: 10
Joined: Tue Jul 15, 2003 12:02 pm

Post by cornuletz »

Pe computer se afla PHP Version 4.3.1, Apache/1.3.24, mysql 3.23.49
User avatar
Dr. Voidberg
Moderator
Posts: 2718
Joined: Tue Dec 24, 2002 1:17 pm

Post by Dr. Voidberg »

The_beast, ai zis-o. :D
Calea catre directorul temporar e ok? Ca de obicei, chiar daca ai versiunea de windows, ea e setata catre /tmp/ care evident nu functioneaza. Daca e asa pune-o catre alt director (de ex. c:\winnt\temp). Setarea e in php.ini.
Edit: am presupus ca esti pe windows.
96 percent of Americans believe that Mr. T still pities the fool.
Radical dreamer
cornuletz
Posts: 10
Joined: Tue Jul 15, 2003 12:02 pm

Post by cornuletz »

Calea catre directorul temporar e bine setata.
User avatar
qbic
Posts: 13
Joined: Mon Aug 23, 2004 9:48 am

Post by qbic »

id-ul de sesiune este identic in cele 2 pagini?? sau iti creeaza cate o sessiune diferita in cele 2 pagini???
cornuletz
Posts: 10
Joined: Tue Jul 15, 2003 12:02 pm

Post by cornuletz »

Sesiuni diferite in cele 2 pagini.
User avatar
qbic
Posts: 13
Joined: Mon Aug 23, 2004 9:48 am

Post by qbic »

Nu ar trebui sa fie aceiasi sesiune ca sa poti acesa datele respective??
The session support allows you to register arbitrary numbers of variables to be preserved across requests. When a visitor accesses your site, PHP will check automatically (if session.auto_start is set to 1) or on your request (explicitly through session_start() or implicitly through session_register()) whether a specific session id has been sent with the request. If this is the case, the prior saved environment is recreated.
Printing the SID, like shown below, is not necessary if --enable-trans-sid was used to compile PHP
PHP is capable of transforming links transparently. Unless you are using PHP 4.2 or later, you need to enable it manually when building PHP. Under Unix, pass --enable-trans-sid to configure. If this build option and the run-time option session.use_trans_sid are enabled, relative URIs will be changed to contain the session id automatically.
si in in continuare

Code: Select all

nextpage.php
<?php
if (!session_is_registered('count')) {
   session_register('count');
   $count = 1;
} else {
   $count++;
}
echo $count."#";
?><a href="nextpage.php?<?php echo strip_tags(SID); ?>">clicka-clika </a>
http://ro2.php.net/manual/ro/ref.sessio ... .idpassing
User avatar
Develz
Posts: 84
Joined: Thu Aug 12, 2004 3:53 pm

Post by Develz »

3.php NU include funtia

include(*adresafisier*);

ca astfel sesiunile sa fie ACELEASI.

( dragging the content from one, to another )
Doua lucruri m-au umplut neincetat de o isterie metafizica : un ceas care sta, si un ceas care umbla.
Post Reply