Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> problem z sesjami
pwa
post
Post #1





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 9.07.2003
Skąd: krakow

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


mam problem z sesja poniewaz nie moge nic zapisac do zmiennej sesji
oto moje kody zrodlowe w 3 plikach:

strona1.php:
[php:1:a119dfbf45]<?php
session_start();

$HTTP_SESSION_VARS['zmienna_sesji'] = "Witaj świecie!";

echo 'Zawartość zmiennej $HTTP_SESSION_VARS['zmienna_sesji'] wynosi '
.$HTTP_SESSION_VARS['zmienna_sesji'].'<br>';

?>
<a href="strona2.php">Następna strona</a>

[/php:1:a119dfbf45]

strona2.php:

[php:1:a119dfbf45]<?php
session_start();

echo 'Zawartość zmiennej $HTTP_SESSION_VARS['zmienna_sesji'] wynosi '
.$HTTP_SESSION_VARS['zmienna_sesji'].'<br>';

unset($HTTP_SESSION_VARS['zmienna_sesji']);
?>
<a href="strona3.php">Następna strona</a>

[/php:1:a119dfbf45]

strona3.php:

[php:1:a119dfbf45]<?php
session_start();

echo 'Zawartość zmiennej $HTTP_SESSION_VARS['zmienna_sesji'] wynosi '
.$HTTP_SESSION_VARS['zmienna_sesji'].'<br>';

session_destroy();


?>[/php:1:a119dfbf45]

problem polega na ty ze w strona1.php zapisuje wartosc do zmiennej sesji
a w strona2.php wartosci tej juz nie ma nieiwme moze mam php.ini zle skonfigurowany :?:
Go to the top of the page
+Quote Post
Seth
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


Tutaj http://forum.php.pl/viewtopic.php?p=32420#32420 jest wytlumaczone jak uzywac sesji. Sprobuj na tym przykladzie dopasowac Twoj skrypt. Jakby co pisz tutaj to dalej cos pomyslimy.
Go to the top of the page
+Quote Post
pwa
post
Post #3





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 9.07.2003
Skąd: krakow

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


ok
Go to the top of the page
+Quote Post
pwa
post
Post #4





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 9.07.2003
Skąd: krakow

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


dalej niestety ta zmienna jest pusta tym raem zrobilem tak:

index.php:

[php:1:294b9c5eb0]<?php
session_start();

$_SESSION['login'] = 'ktos';

echo 'to co zapisalem: '. $_SESSION['login'].'.';
?>
<br><br><a href="index2.php">nastepna</a>
[/php:1:294b9c5eb0]

index2.php:
[php:1:294b9c5eb0]
<?php
session_start();

echo 'to co zapisalem: '. $_SESSION['login'].'.';

?> [/php:1:294b9c5eb0]

i dalej zminenna mam pusta (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
Seth
post
Post #5





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


Daj jeszcze tak:
[php:1:2d332c29f5]<a href="index2.php?<?php print SID; ?>">nastepna</a>[/php:1:2d332c29f5]
Go to the top of the page
+Quote Post
pwa
post
Post #6





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 9.07.2003
Skąd: krakow

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


niestety dalej nic
Go to the top of the page
+Quote Post
Seth
post
Post #7





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


Masz jakis blad ?

Uruchom jeszcze ten skrypt co podalem w linku.
Go to the top of the page
+Quote Post
pwa
post
Post #8





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 9.07.2003
Skąd: krakow

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


niestety dalej mam puste zmienne

-----

najdziwniejsze jest to ze nie pokazuje mi zadnych warning-s
Go to the top of the page
+Quote Post
Seth
post
Post #9





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


Jaki masz server i gdzie ?
Czy ustawiles sciezki do katalogu dla sesji w php ?
Go to the top of the page
+Quote Post
pwa
post
Post #10





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 9.07.2003
Skąd: krakow

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


mam serwer apache pod windowsa u siebie na kompie
zaraz pokaze ci php.ini z sesjami
Go to the top of the page
+Quote Post
Seth
post
Post #11





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


Jak mozesz to wejdz na irc.php.pl kanal #php.pl
Go to the top of the page
+Quote Post
pwa
post
Post #12





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 9.07.2003
Skąd: krakow

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


[Session]
session.save_handler = files ; handler used to store/retrieve data
session.save_path = c:documents and settingsadministratorcookies ; argument passed to save_handler
; in the case of files, this is the
; path where data files are stored
session.use_cookies = 1 ; whether to use cookies
session.name = PHPSESSID
; name of the session
; is used as cookie name
session.auto_start = 0 ; initialize session on request startup
session.cookie_lifetime = 0 ; lifetime in seconds of cookie
; or if 0, until browser is restarted
session.cookie_path = c:documents and settingsadministratorcookies ; the path the cookie is valid for
session.cookie_domain = ; the domain the cookie is valid for
session.serialize_handler = php ; handler used to serialize data
; php is the standard serializer of php
session.gc_probability = 1 ; percentual probability that the
; 'garbage collection' process is started
; on every session initialization
session.gc_maxlifetime = 1440 ; after this number of seconds, stored
; data will be seen as 'garbage' and
; cleaned up by the gc process
session.referer_check = ; check HTTP Referer to invalidate
; externally stored URLs containing ids
session.entropy_length = 0 ; how many bytes to read from the file
session.entropy_file = ; specified here to create the session id
; session.entropy_length = 16
; session.entropy_file = /dev/urandom
session.cache_limiter = nocache ; set to {nocache,private,public} to
; determine HTTP caching aspects
session.cache_expire = 180 ; document expires after n minutes
session.use_trans_sid = 1 ; use transient sid support if enabled
; by compiling with --enable-trans-sid
url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
Go to the top of the page
+Quote Post
pwa
post
Post #13





Grupa: Zarejestrowani
Postów: 60
Pomógł: 0
Dołączył: 9.07.2003
Skąd: krakow

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


jestem na irc
Go to the top of the page
+Quote Post
Seth
post
Post #14





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


Daj sciezke na cos w tym stylu:
Cytat
session.save_path = d:srvPHPsessiondata

aby w sciezce nie bylo spacji i nazwy katalogow nie byly wieksze niz 8 znakow.
I potem sprobuj to odpalic.
Go to the top of the page
+Quote Post
damianeusz
post
Post #15





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 10.09.2003
Skąd: sosnow

Ostrzeżenie: (10%)
X----


szkoda ze dialog się urwał bo mam dokładnie ten sam problem.
chlopaki jesli udalo wam sie rozwiazac problem to dajcie znac
Go to the top of the page
+Quote Post
Seth
post
Post #16





Grupa: Przyjaciele php.pl
Postów: 2 335
Pomógł: 6
Dołączył: 7.03.2002

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


pwa mial starsza wersje php dlatego nie dzialalo.
Go to the top of the page
+Quote Post
damianeusz
post
Post #17





Grupa: Zarejestrowani
Postów: 5
Pomógł: 0
Dołączył: 10.09.2003
Skąd: sosnow

Ostrzeżenie: (10%)
X----


to znaczy ponizej 4?
jaka wersja?
Go to the top of the page
+Quote Post
KaMeLeOn
post
Post #18





Grupa: Zarejestrowani
Postów: 680
Pomógł: 0
Dołączył: 1.10.2002
Skąd: Wrocław

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


Cytat
to znaczy ponizej 4?
jaka wersja?
Poniżej wersji 4.1.0...
Go to the top of the page
+Quote Post
zuku
post
Post #19





Grupa: Zarejestrowani
Postów: 44
Pomógł: 0
Dołączył: 17.04.2002
Skąd: Jastrzębie Zdrój

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


Mam dokładnie ten sam problem...

W linku pojawia mi się tylko:
Cytat
admin.php?

i nic więcej.

W php.ini na serwerze (linux) mam ustawione:
Cytat
session.save_path = /tmp

chyba dobrze co?

Fajnie jak by ktoś dał znać co i jak (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post
geminek
post
Post #20





Grupa: Zarejestrowani
Postów: 28
Pomógł: 0
Dołączył: 16.05.2003

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


Dokladnie!
Ja tez mam ten sam problem!
Moze tu chodzi o Apache'a! Ja mialem cos tagiego jak PHPTriad. Moze z tym sa jakies problemy. Co o tym sadzicie?(IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post

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: 22.08.2025 - 13:28