"Voodoo" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm using a local Apache 1.3 server on WinXP, and I've gotta test some php > scripts at home, can't publish them. I'm trying to set some session vars, > but the variables simply disappear when I try to use them again. Made the > following code to test it, but when I click on 'increment' the 'numb' var is > set to 0 again. > > > //code on test.php: > <?php > session_start(); > if (isset($_SESSION['numb'])) { > $_SESSION['numb']++; > } else { > $_SESSION['numb'] = 0; > } > echo $_SESSION['numb']."<br>"; > ?> > <a href="test.php">Increment</a>
I copied and pasted the above code and it worked perfectly. You may need to check some following settings in your php.ini session.use_cookies session.use_trans_sid session.cookie_path session.save_path. These are some I can think of right off that might be causing problems. You're probably using cookies, and I'd bet the save_path needs setting, as it probably wouldn't default to something valid. -- Rob > > The strange thing is that when I publish this 'test.php' file on a web > server it works just fine. I think there's something wrong with my local > server configuration or at the php.ini file, but I can't figure out what is > it. > > Can somebody help me? > > Thanks, > > Voodoo > > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php