PHP Code:<?
if ($_SESSION['username'] = '".$username."'); {
echo("member stuff.");
}
include_once "login.html";
?>

PHP Code:<?
if ($_SESSION['username'] = '".$username."'); {
echo("member stuff.");
}
include_once "login.html";
?>
How's that going to work Assasinator...?PHP Code:<?
if ($_SESSION['username'] = '".$username."'); {
echo("member stuff.");
}
include_once "login.html";
?>
invent your code = http://zetolic.com/ still shows login.
Last edited by Colin-Roberts; 03-02-2008 at 07:44 PM.
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
remove the include("login.html"); bit then..
EDIT:
Should work.PHP Code:<?php
session_start(); // If this is the full document you require session_start
if ($_SESSION['username'] == $username)
{
echo("member stuff.");
}
else
include("login.html");
?>
Coming and going...
Highers are getting the better of me
Simple...PHP Code:<?php
session_start(); // If this is the full document you require session_start
if ( isset( $_SESSION["username"] ) && $_SESSION['username'] == $username && !empty( $_SESSION["username"] ) )
{
echo("member stuff.");
}
else
{
include("login.html");
}
?>
Last edited by Invent; 03-02-2008 at 07:47 PM.
still shows login.html below it
I'm confused.
Last edited by Colin-Roberts; 03-02-2008 at 07:48 PM.
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
Simon,
Surely you dont need the isset bit, If it contains the username then of course its going to be set?
Coming and going...
Highers are getting the better of me
That'll DEFINATELY work...PHP Code:<?php
session_start(); // If this is the full document you require session_start
if ( isset( $_SESSION["username"] ) && $_SESSION['username'] == $username && !empty( $_SESSION["username"] ) )
{
echo("member stuff.");
}
else
{
include("login.html");
}
?>
Actually, you probably do need it...Surely you dont need the isset bit, If it contains the username then of course its going to be set?
If the session ISN'T set then the value will be blank/null. If the $username variable isn't set (logged out) then it'll be blank/null. Using isset will stop it showing the members stuff if the session doesn't exists.
Last edited by Invent; 03-02-2008 at 07:49 PM.
now even if i'm logged in it doesn't show the members linksoh well.
Last edited by Colin-Roberts; 03-02-2008 at 07:58 PM.
.:.:#14:.:. .:.: Impossible Is Nothing :.:. .:.: 845 Rep:.:.
.:.: Stand up for what is right, even if you stand alone:.:.
Want to hide these adverts? Register an account for free!