Page 1 of 1

session help

Posted: Fri Feb 09, 2007 7:33 pm
by qqragoon
hi, I have read some post of the session. It seems easy, but, i couldn't get it to work..... please help.

Page 1:

PLEASE USE PHP TAG

Code: Select all

<? session_start();
     $_SESSION["var"] = "PART 0001";

echo "part name is ".$_SESSION["var"];
?>

Page 2:

Code: Select all

<? session_start();

echo "now the part number is ".$_SESSION["var"];
?>

page 1 and page 2 are simple http link. the output of page 1 is correct. However, output of page 2 is "now the part number is ". it seems like the data was not passed. did i miss something? thanks!

Posted: Fri Feb 09, 2007 7:36 pm
by feyd
What are the session settings that can be found in phpinfo()?

How are you getting from page 1 to page 2?

Posted: Fri Feb 09, 2007 8:23 pm
by qqragoon
feyd wrote:What are the session settings that can be found in phpinfo()?

How are you getting from page 1 to page 2?
I like to use simple link between page1 and page2. Just a http link on page1 that can be linked to page2. Is this doable? Or I can do submit if it is necessary. Please see below information from phpinfo(). This is php 5.2.0 (sorry for the format, i don't know how to load picture here) Thanks!

session
Session Support enabled
Registered save handlers files user
Registered serializer handlers php php_binary wddx


Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 Off Off
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter nocache nocache
session.cookie_domain no value no value
session.cookie_httponly Off Off
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.hash_bits_per_character 5 5
session.hash_function 0 0
session.name PHPSESSID PHPSESSID
session.referer_check no value no value
session.save_handler files files
session.save_path C:\DOCUME~1\qqragoon\LOCALS~1\Temp\php\upload C:\DOCUME~1\qqragoon\LOCALS~1\Temp\php\upload
session.serialize_handler php php
session.use_cookies On On
session.use_only_cookies Off Off
session.use_trans_sid 0 0 [/url][/syntax]

Posted: Fri Feb 09, 2007 11:18 pm
by feyd
I would have to guess that it attempted to set the cookie but your browser didn't accept it or was unable to pass it to your link.

Posted: Sat Feb 10, 2007 1:50 am
by qqragoon
I have tried different browser in different location. They should have no problem..... Does anyone know what is the problem??? Thanks!

Posted: Sat Feb 10, 2007 9:26 am
by RobertGonzalez
save_path issue perhaps? Or maybe a permission issue on the save path?

Posted: Sat Feb 10, 2007 4:48 pm
by qqragoon
Everah wrote:save_path issue perhaps? Or maybe a permission issue on the save path?
Thanks, Everah!! Problem solved!

The save_path folder "../temp/php/upload" was not exist. I guess the php program didn't install it automatically....:) Thanks for all your guys help.

Posted: Sat Feb 10, 2007 4:58 pm
by RobertGonzalez
You got it. Glad I could help.