Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Where to place $Session MM_Username

Participant ,
Jan 07, 2010 Jan 07, 2010

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?

TOPICS
Server side applications
1.6K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jan 11, 2010 Jan 11, 2010

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

...
Translate
LEGEND ,
Jan 07, 2010 Jan 07, 2010

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 08, 2010 Jan 08, 2010

See the following article: http://cookbooks.adobe.com/post_Display_user_s_name_and_other_details_after_login-16672.html.


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 11, 2010 Jan 11, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 11, 2010 Jan 11, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 11, 2010 Jan 11, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 11, 2010 Jan 11, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 11, 2010 Jan 11, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 12, 2010 Jan 12, 2010
LATEST

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines