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
npodges
Forum Newbie
Posts: 12 Joined: Tue Aug 12, 2003 5:55 pm
Post
by npodges » Fri Mar 12, 2004 4:10 pm
i'm having problems using session_start(). ultimately, i want to make a login session, but even using simpler code from the php documentation, i get errors.
Code: Select all
<?php
// page1.php
session_start();
echo 'Welcome to page #1';
$_SESSIONї'favcolor'] = 'green';
$_SESSIONї'animal'] = 'cat';
$_SESSIONї'time'] = time();
// Works if session cookie was accepted
echo '<br /><a href="page2.php">page 2</a>';
// Or maybe pass along the session id, if needed
echo '<br /><a href="page2.php?' . SID . '">page 2</a>';
?>
http://68.41.89.22/retard.php <- the page with errors
http://68.41.89.22/test.php <- my phpinfo()
thanks.
-nick podges
andre_c
Forum Contributor
Posts: 412 Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah
Post
by andre_c » Fri Mar 12, 2004 4:13 pm
You need to set the php.ini file to
session.save_path = C:\PHP\sessiondata
instead of
/tmp
npodges
Forum Newbie
Posts: 12 Joined: Tue Aug 12, 2003 5:55 pm
Post
by npodges » Fri Mar 12, 2004 4:21 pm
well, i've got php installed into c:/php-4.3.4-Win32.
there's no sessiondata folder there. should there be?
-nick podges
andre_c
Forum Contributor
Posts: 412 Joined: Sun Feb 29, 2004 6:49 pm
Location: Salt Lake City, Utah
Post
by andre_c » Fri Mar 12, 2004 4:23 pm
actually you can name it whatever you want, but make sure if it's not there, create it.
You might also have to restart your web server (not sure)