Copy link to clipboard
Copied
I know the code for the $session to make a username but where exactly do I place it on my login page so that it creats the variable and then where exactly do I place the code to display that session on one of my pages?
Just pause for a moment to reflect on what you have just written. You say you know you have created a correct session variable because Dreamweaver did it for you. At the same time, you say it doesn't display. Doesn't that tell you that something is wrong somewhere? If the session variable has been created correctly - and you're using it correctly - it should display. But without showing others any of your code, there's no way anyone can tell you why it's not working.
Relying on Dreamweaver to do
...Copy link to clipboard
Copied
You would create and assign the session variable after the user is authenticated. To display it, put it on the page exactly where you want it to appear. Right?
Copy link to clipboard
Copied
See the following article: http://cookbooks.adobe.com/post_Display_user_s_name_and_other_details_after_login-16672.html.
Copy link to clipboard
Copied
Thank you Mr.Power you have pointed me to that same link before but I have successfully created a session variable but when i try to display it it won't display.
Copy link to clipboard
Copied
gabessdsp wrote:
I have successfully created a session variable but when i try to display it it won't display.
If it fails to display, you have NOT successfully created a session variable. First of all, you need to use session_start(); before you can work with session variables. Secondly, your subject line refers to $Session MM_Username. That's complete nonsense in PHP. It's $_SESSION['MM_Username']. Correct syntax is vital when working with a server-side language like PHP.
Copy link to clipboard
Copied
I know I created a correct Session variable because dreamweaver automatically did it for me when I made my login page and because my restrict access to page functions work.
Copy link to clipboard
Copied
Just pause for a moment to reflect on what you have just written. You say you know you have created a correct session variable because Dreamweaver did it for you. At the same time, you say it doesn't display. Doesn't that tell you that something is wrong somewhere? If the session variable has been created correctly - and you're using it correctly - it should display. But without showing others any of your code, there's no way anyone can tell you why it's not working.
Relying on Dreamweaver to do everything for you automatically is a recipe for frustration.
Copy link to clipboard
Copied
Thanks for the advice I wish I couldshow you my code but I do not have internet at home so i have to come all the way to a public library an
d use their computers to post on this site.
Copy link to clipboard
Copied
Perhaps this is the problem. Dreamweaver did it for you on the login page. Are login-page and logged-in page in the same file? If you are switching to another file:
Are sessions started there?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now