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.

Link to comment
https://forums.phpfreaks.com/topic/272307-if-not-logged-in-show-login-else-hello/
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.

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.

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! :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.