My problem about seesion

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Genux
Forum Newbie
Posts: 4
Joined: Thu Dec 26, 2002 9:03 pm
Location: Changhua,Taiwan,ROC
Contact:

My problem about seesion

Post by Genux »

I got a big trouble about using session
follow is my ERROR message:
Warning: open(/tmp\sess_9a6cec248fd2262e14e7a1bf52cb0d1d, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0


how should I config my php.ini??
my php.ini is :
session.save_path = \tmp
session.cookie_path = \
session.save_handler = files

My OS is winXP

sorry....My English is very poor....
Thanks for your answer....
User avatar
BigRed
Forum Newbie
Posts: 6
Joined: Thu Dec 26, 2002 11:47 am

Post by BigRed »

Make it x:\tmp, where x is the letter of your hard drive. Make sure there is a folder called tmp in your x:\ drive.
Hope that helps.
Genux
Forum Newbie
Posts: 4
Joined: Thu Dec 26, 2002 9:03 pm
Location: Changhua,Taiwan,ROC
Contact:

Post by Genux »

thanks a lot
but now...I got a new trouble
I can use session
but the value of session always 1
<page1.php>
<?php
session_register('uid');
?>
<page2.php>
<?php
print(session_register('uid'));
?>
uid is the text field and it's name is uid.
but when I input characters into uid
page2.php always print 1

what should I do???
qads
DevNet Resident
Posts: 1199
Joined: Tue Apr 23, 2002 10:02 am
Location: Brisbane

Post by qads »

give this a try:

Code: Select all

<?php
//page1.php
session_start();
$_SESSION[uid] = $_POST[uid];

//page2.php 
session_start();
echo $_SESSION[uid];
?>
Post Reply