You are not logged in.

#1 2005-03-17 11:21:02

tmadhavan
Member
From: Wales :D
Registered: 2004-03-26
Posts: 441

PHP having a permanent status 'bar' at the top of page

Hey all

I'm doing a php project for my degree, I have to design and implement an auction site.

Now, what I want is for there to be a bar (i.e. just a table row (two columns)) going across the top of the screen. One table cell holds my website logo, so that's permanent. The other cell needs to:

a) show a login box if no-one is logged in. You are logged in if $_SESSION('LoggedIn') is TRUE.

b) show 'Welcome, $username' or some such if the user is logged in.

Now, this needs to be included on every page, so I guess it'll just be put into an include file. My problem is, I just can't get it to work. Either the login message is displayed under the table, or a new table is displayed, or it just doesn't work.

I.e. if you are NOT logged in, and then login, a new image and message is displayed underneath the old - I need the page to be refreshed, but I'm not sure how.

Any ideas? Also, does the php just need to be embedded? E.g.:

 
<html>
<body>
<table>
<td>
<?php if (loggedin) {
    blah;
}
else { blah2}
?>
</td>
</table>
</body>
</html?

Ta.
T

Offline

#2 2005-03-17 13:40:35

Pajaro
Member
Registered: 2004-04-21
Posts: 876

Re: PHP having a permanent status 'bar' at the top of page

hey hey hey!

You want us to do your work.

Try asking in HTML or php forums, maybe there you'll find a freak that'll do your work for you.

Offline

#3 2005-03-17 16:27:13

InfernalH
Member
From: Lithuania/Klaipeda-Vilnius
Registered: 2005-02-08
Posts: 101
Website

Re: PHP having a permanent status 'bar' at the top of page

dude, you asked and answered your question in logical way - just sit and do it! http://lt.php.net/manual/en/ is your friend!

Offline

#4 2005-03-18 08:23:18

tmadhavan
Member
From: Wales :D
Registered: 2004-03-26
Posts: 441

Re: PHP having a permanent status 'bar' at the top of page

Heh, sorry guys. Got it sorted now, tho not quite how I wanted.

Infernal - I realise my question is somewhat answered, my problem was (I think) with syntax, hence me getting the wrong results.

I've now fixed the issue by creating a login.php script which is linked to unless the use is logged in.

T

Offline

Board footer

Powered by FluxBB