Showing either an image or a form

On a site I am developing I am trying to display either a login form, or an image, depending on whether the user is logged in or not. I am using sitelok to provide login administration.

The site can be viewed at http://sjcars.org/beta.php

Initially, the login form is displayed in the top right corner of the page. Once the user is logged in I would like to display an image instead of the login form.

You can go ahead and test what I mean. Login with Call Sign of “guest” and password of “guest”. You can see that the login form disappears if you login correctly. I did this by enclosing the form in PHP code which tests the user’s access rights. Once logged in, click on the Members link of the left menu. The “MEMBER” graphic shown on the top right of the Members page is what I would like to show on the top right of the home page once the user is logged in.

Any suggestions?

Thanks,
Jim


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Jim,
It sounds like you are almost there. You just need to extend your log-in
checking code with an else block.
Pseudo code;

<?php if (!logged-in){ echo("Log-in form HTML"); } else { echo("member-image HTML"); } ?>

Regards,
Tim (from snowy Seattle).

Quoting Starfish Jim email@hidden:

On a site I am developing I am trying to display either a login form, or an
image, depending on whether the user is logged in or not. I am using sitelok
to provide login administration.

The site can be viewed at http://sjcars.org/beta.php

Initially, the login form is displayed in the top right corner of the page.
Once the user is logged in I would like to display an image instead of the
login form.

You can go ahead and test what I mean. Login with Call Sign of “guest” and
password of “guest”. You can see that the login form disappears if you login
correctly. I did this by enclosing the form in PHP code which tests the
user’s access rights. Once logged in, click on the Members link of the left
menu. The “MEMBER” graphic shown on the top right of the Members page is what
I would like to show on the top right of the home page once the user is
logged in.

Any suggestions?

Thanks,
Jim


Extend Freeway the way you want with FreewayActions.com
http://www.freewayactions.com


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Tim,

Sweet! It took a couple tries, but I’ve got it. I’m fairly new at PHP coding, so I’m still trying to grok its concepts. I hadn’t previously clicked on the fact that the code was generating the html to be viewed instead of actually controlling the browser. Thanks much for the point in the right direction.

Jim


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options