Page 1 of 1

html/php code help

Posted: Fri Dec 06, 2013 7:33 pm
by kierongi
hey guys been a while how is things?


i am having a little trouble with some coding

what i am trying to do is hide a button (which is for people to log in) when they are logged in so they cannot see this

here is my current banner

Image

on this page i am currently logged in and due to this i want the log-in and register to disappear and when i am not logged in i want the log-out to disappear

hope i have explained it ok

Thank you

Kieron

Re: html/php code help

Posted: Fri Dec 06, 2013 7:42 pm
by hallsofvallhalla
several ways of doing this. quick and dirty way is to check for session id and if it does not exist then add code in PHP or javascript to add it

quick pseudo code

Code: Select all

<?php
if(!$isset($_Session['Id']))
{
echo "<a href='/logon.php' ><img src='/images/logonButton.png' ></a>";
}

Re: html/php code help

Posted: Fri Dec 06, 2013 7:50 pm
by kierongi
thanks for the quick reply Halls

how would i create a session start ID

Thanks

EDIT: thanks for the help managed to do what i wanted with your help