simple5imon Posted September 15, 2006 Share Posted September 15, 2006 Ive been searching here but cannot find the coding for this >:(I'd like it so, users have to login to gain access to the website pages.[b]ALSO[/b] id like the coding so it shows their name somewhere so they know their logged in!Hope this is enough info!Much appreciation ;) Quote Link to comment Share on other sites More sharing options...
Wintergreen Posted September 15, 2006 Share Posted September 15, 2006 There's a login tutorial on this site that works fine. As for making sure they're logged in to view any pages, all you do is make a file called logincheck.php or something, and put this inside[code]<?session_start();if(empty($_SESSION['username'])) { header("location: index.php");}?>[/code]Then at the top of each page (Except index.php), put this[code]<?session_start();include 'logincheck.php';?>[/code]This works in conjunction with the login tutorial on the site. Quote Link to comment Share on other sites More sharing options...
Wintergreen Posted September 15, 2006 Share Posted September 15, 2006 Here's the tutorial:http://www.phpfreaks.com/tutorials/65/0.phpYou'll have to change some of the table to fit what you need, which will in turn make it so you need to change some other stuff as well, but it won't be hard. Since you're doing a site, I doubt you'll have people use their real names, so you don't need a first name or last name, just a username. Things like that, they're not too hard to watch out for. Also, you don't need to bother with the marketing stuff, just the membership system. Quote Link to comment Share on other sites More sharing options...
simple5imon Posted September 15, 2006 Author Share Posted September 15, 2006 Thanks for that Wintergreen, i'll give that a go! ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.