...

View Full Version : Login echo array



Hydrian
08-26-2012, 04:41 AM
I have this in my website using it in my chat. I recommend it if you have a login system. and need to see if a user is or isnt logged in


<?php
session_start();
include_once"config.php";
if(!isset($_SESSION['username']) || !isset($_SESSION['password'])){
echo '<h4>You are not logged in. Please do so <a href="http://jays.netne.net/loginsystem/login.php">Login</a></h4>'; }


else {
echo "<h4>You are logged in </h4>";
}
?>

_Aerospace_Eng_
08-26-2012, 05:37 AM
The problem with this though is you will echo out text before any DOCTYPE in your HTML because a session_start() needs to be called be any headers. It might be better to just setup a string with the message and then print it out later in the body of your HTML.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum