Results 1 to 2 of 2
Hybrid View
-
19th Nov 2010, 03:50 PM #1OPMemberWebsite's:
rootw.netQuick PHP help...
Hey everyone. I'm coding a simple members area for my website, but i need Alittle help.
Basically I want it to be something like /path/membersindex.php and /path/subpage.php etc.
So on every page i want there to be the code below to check if the person is logged in, and if they're not it shows a logged in screen.
So far I got:
PHP Code:<?php
if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']))
{
//content here
}
else
{
//put the login form here
}
<?>
PHP Code:<?php
require "sessioncheck.php"; //checks if user is logged in, if they aren't, the page displays a login screen.
//rest of the page content herenarutoroot Reviewed by narutoroot on . Quick PHP help... Hey everyone. I'm coding a simple members area for my website, but i need Alittle help. Basically I want it to be something like /path/membersindex.php and /path/subpage.php etc. So on every page i want there to be the code below to check if the person is logged in, and if they're not it shows a logged in screen. So far I got: <?php Rating: 5
-
19th Nov 2010, 07:23 PM #2Respected Member
That should work except use require_once and not require. Also make sure to add a return after it displays the login form so it doesn't drop into the code below it.
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Quick hello
By Jim Haynes in forum IntroductionsReplies: 5Last Post: 7th Feb 2012, 01:09 AM -
Just a quick hello.
By NordicNode in forum IntroductionsReplies: 12Last Post: 13th Dec 2011, 02:12 AM -
[Hiring] Quick Job - $5
By viruz99 in forum Completed TransactionsReplies: 6Last Post: 9th Nov 2011, 05:07 PM -
[Hiring] After Effects Editor (Quick Job = Quick Money)
By MasterDKR in forum Completed TransactionsReplies: 4Last Post: 21st Jun 2011, 08:09 PM -
A quick LOL.
By Luke in forum General DiscussionReplies: 4Last Post: 8th Jun 2009, 11:09 AM
themaCreator - create posts from...
Version 3.47 released. Open older version (or...