Page 1 of 1

sessions...

Posted: Wed Aug 05, 2009 6:20 am
by Torniquet
Is it possable to check the session isset in an include rather than typing the whole thing out every time at the top of the page?

and just add like incluce "sessioncheck.php"

if there is no session set, redirect them back to the index page. but if there is leave it blank so it can continue?

Re: sessions...

Posted: Wed Aug 05, 2009 12:35 pm
by Noctrine
I'd rather do it in a function, but yes.

Re: sessions...

Posted: Wed Aug 05, 2009 12:43 pm
by Torniquet
how would you do it through a function?

wouldnt that mean using an include to get the function from another page?

never worked with functions on here lol.

Re: sessions...

Posted: Wed Aug 05, 2009 12:49 pm
by Noctrine

Re: sessions...

Posted: Wed Aug 05, 2009 1:08 pm
by hallsofvallhalla
functions can be used right in a page but if you dont know how to copy and paste then I suggest a include. I often make a shell of each page then build on that shell. The shell might be called shell.php where it already has all the includes and .css sheet attachment, then you save as the file you want and build on it. When you need the next page just open shell back up and save as again.

Re: sessions...

Posted: Wed Aug 05, 2009 1:18 pm
by Torniquet
ye i do the same thing (but to be honest i didnt think of adding it onto my shell as i used the shell for my login / register pages)

I SHALL UPDATE MY SHELL :D :p

seems a much simpler idea lol.