passing session variables through URL
Posted: Thu Aug 18, 2005 11:48 am
I want to set a session variable by passing it to another page through a URL. The URL is set in a POST form. Here is what I have written:
When this form is submitted the page loads with the URL looking like:
http://www.theSite/step.php?$_SESSION['nextPage']=setup
However, the $_SESSION var is not changed. Is there some other syntax I must put in to make it change as the page is passed?
Alternatively I could just look on the next page for the $_POST['setup'] variable, but this doesn't work either. Does this all have something to do with the fact that my button is an image? I wouldn't think so. Let me know if you have any clues. Thanks.
Code: Select all
<form
METHOD="POST" action= "./step.php?$_SESSION['nextPage']=setup">
<input type="image" src="./images/settings.png" value="setup" name="setup">
</form>http://www.theSite/step.php?$_SESSION['nextPage']=setup
However, the $_SESSION var is not changed. Is there some other syntax I must put in to make it change as the page is passed?
Alternatively I could just look on the next page for the $_POST['setup'] variable, but this doesn't work either. Does this all have something to do with the fact that my button is an image? I wouldn't think so. Let me know if you have any clues. Thanks.