freecrm
New Member
- Messages
- 629
- Reaction score
- 0
- Points
- 0
Oh...shame that..
I'm using 4 pages - the $memid is created on the second page and $GET to retrieve it on the third page but I need it on the fourth as well. So can you tell me exactly how I create the session variable?
Thanks as always_
No problem.. simple.
When you've created your random $memid on the 2nd page, just below it, put
PHP:
$_SESSION['memid'] = $memid;
This session variable is now set for every page the browser visits until he closes the browser. In other words, you no longer have to send it in the URL so the links you are using from page 2 to 3 can be set to the standard lin without the ?memid=<?php echo etc. etc.
On the 3rd and fourth page, instead of using
PHP:
$_GET['memid']
use
PHP:
$_SESSION['memid']
Both will pull the variable from session memory.
Edit:
Just remembered..
You need to make sure you have the session started.
Just put
PHP:
session_start();
at the very top of the page.
Last edited: