|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hey all,
having a spot of bother with my lame ass Final Project and was wondering if any of you bigger brains out there could help me as i left my spare bigger brain at home. I'm creatin a members only section for an existing site. once users log in they will be able to view the publications that they subscribe to. so what i would like to do is save their usernames and passwords or User_ids as session variables so that as they continue thru the site it will show information relevant to them from the database. if you catch my drift. now the problem is. i can't get the damn variables out there!! my site currently works around 2 php pages, one with the form to fill in and the other that it posts to which then links to the main intro page. so here goes * Please post code blocks within the appropriate [ code ] or [ php ] formatting tags * PHP Code:
if any of you can help i would just adore you for the rest of my long legged life. Thanks Natt ![]() |
|
#2
|
||||
|
||||
|
Try this to register session variables:
PHP Code:
Then simply echo $_SESSION['username']; in the future, try putting [ php][/php ] tags around your code (Without the spaces)... this will colour-ize your syntax |
|
#3
|
|||
|
|||
|
Don't use session_register: my (admittedly old) PHP manual says:
"Caution If you are using $_SESSION (or $HTTP_SESSION_VARS), do not use session_register(), session_is_registered() and session_unregister(). " I think Natt's problem was just that he missed out the quotes $_SESSION['username']; $_SESSION['password']; |
|
#4
|
|||
|
|||
|
Anna's right... Those functions were used prior to the super global arrays... To start a session, you can simply create your first session object, and the session should automatically register itself. If I'm wrong in this, please do correct me.
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > PHP MySQL Session Variables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|