Posted 04 September 2006 - 03:09 PM
Posted 04 September 2006 - 03:25 PM
So to create a session that holds your name, use:
$_SESSION['name'] = 'jwk811']
That creates a session variable called name. Which holds jwk811 as its value.
Now to use that in any page. Make sure you have session_start() at the top of the page now add:
echo $_SESSION['name'] where you want your name to appear.
Also when ever you use the sesison_start or setcookie function make sure you are not putting anything to the browser, otherwise you'll either get a blank screen or a nasty header cannot be sent error message.
Posted 04 September 2006 - 04:38 PM
Posted 04 September 2006 - 04:43 PM
Also search google for "using sessions with PHP" and "using cookies with PHP" they should return some results.
When I started using sessions I wasnt sure either. There was a good tutorial here when I was learning sessions, but I can find it.
Posted 04 September 2006 - 04:59 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users