Jump to content

If Not Logged In Show Login, Else Hello


ego

Recommended Posts

Hi,

 

a bit of help. Should be easy one for you, I am only newbie:)

 

<?php

if (empty($_SESSION['MM_Username'])) {

if (empty($_SESSION['MM_Username'])) {

echo "Login";

}else{

echo "Hello";

}

}

?>

<?php

 

Trying to get Dreamweaver to show "Login" text, if nobody is logged in. Else "Hello" of logged in user. Upper code nicely showes "Login", but when I logg, nothing is howed. Tnx for your help.

Edited by ego
Link to comment
Share on other sites

I would strongly recommend you to scrap DreamWeaver, and use a proper IDE/editor for your PHP needs. The auto-generation for DW is crap, as with any other code generator tool: They simply cannot produce proper code, as applications don't understand the problem you're trying to solve.

Programming is nothing but understanding and solving problems, and then translating said solution into a programming language so that the computer can replicate the necessary steps.

Edited by Christian F.
Link to comment
Share on other sites

Manixat: tnx vm. I promisse to get more into basics before i ask simple stuff like this, but just had to write something of the top of my newbie mind:)

 

Christian F: I agree with you. After I am done with proper learning i will for sure go and use some more specialized editors.

 

Thanks again to you both. Enjoy coding.

Link to comment
Share on other sites

I would actually recommend doing away with it now, while you're learning. DW has an unfortunate habit of using some rather bad anti-patterns, and insecure code. Stuff which you do not want to pick up as a habit, as you will have to de-learn it afterwards.

It's a lot harder to de-learn something, that it is to learn it in the first place, after all.

 

You're welcome, btw, and have fun you too! :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.