I have a script which is part of a form page. All it does is set a sessin, and the idea is that when the the form is submitted the php script checks the session.
However, an isset check always returns false for the variable- what have I done wrong?!
Please help!
P.S. The php script that makes the session is hiding as an img src, the actual form page is .html and has no php on it.
If you need any code, I can post it
Passing sessions [RESOLVED]
Moderator: General Moderators
Passing sessions [RESOLVED]
Last edited by robokoder on Fri Jan 06, 2006 8:40 am, edited 1 time in total.
I gave up and used cookies
Anyways, it works great and I'd like to say a great big thank you to some users on this forum who helped me out!
The site is at http://encode.fusionnx.com, and forthe 24 hoours or so I'll be opening it to the public- user & pass is 'tester'.
Let me know what you think through PMs, email and replies (I have posted a seperate thread in the chat forum)
Anyways, it works great and I'd like to say a great big thank you to some users on this forum who helped me out!
The site is at http://encode.fusionnx.com, and forthe 24 hoours or so I'll be opening it to the public- user & pass is 'tester'.
Let me know what you think through PMs, email and replies (I have posted a seperate thread in the chat forum)
dude.. seriously, it's as easy as using cookies.. infact, I'd say easier depending on your situation.
page1.php:
page2.php:
But don't confuse sessions with cookies.. if you close the browser, the session will be destroyed. Cookies only get destroyed when they expire.
page1.php:
Code: Select all
<?php
session_start();
$_SESSION['var'] = true;
?>Code: Select all
<?php
session_start();
if ((isset($_SESSION['var'])) && ($_SESSION['var'] === true)) {
echo "Session variable 'var' is boolean and equals true!";
}
?>