labine50 Posted August 7, 2008 Share Posted August 7, 2008 I'm pretty new to PHP and SQL in general. I've basically been doing web development solely in HTML for the last 16 months, (Basically the entire time I've been doing web development) and figured it was time to learn some new stuff. Learning can't hurt, no? Anyway, I play this mildly popular MMO and my group has a website which needs password protection. So far the security system has been based on trying to keep it off of Google. I followed the Tutorial here and made a very simple login system. Unfortunately, it doesn't allow the option to register and seems to only protect one page. The registration thing I should be able to figure out on my own, but for the mutli-page protection... I basically have an entire directory that needs to be protected. Can anybody make recommendations on this? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 7, 2008 Share Posted August 7, 2008 Well, I honestly don't feel like reading the tutorial because it's probably bad code in the first place and I'd rather not comment on it (most tutorials these days are old and outdated). Do you login with sessions or cookies? Quote Link to comment Share on other sites More sharing options...
labine50 Posted August 7, 2008 Author Share Posted August 7, 2008 Well, I honestly don't feel like reading the tutorial because it's probably bad code in the first place and I'd rather not comment on it (most tutorials these days are old and outdated). Do you login with sessions or cookies? It includes this- <? session_start(); if(!session_is_registered(myusername)){ header("location:main_login.php"); } ?> So I think it's sessions. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted August 7, 2008 Share Posted August 7, 2008 Oh boy I knew that there would be bad code. They're using deprecated session functions. >_< You don't need any session_* functions other than like session_start() and session_destroy() because the $_SESSION superglobal is now usable for writing to sessions. And to protect any page, just put that code on the top of the page. Like the very top before any output. But you should really learn a bit of PHP and clean it up. Quote Link to comment Share on other sites More sharing options...
labine50 Posted August 7, 2008 Author Share Posted August 7, 2008 Ah, thanks. I'll put this in place for now and then read through a reference or tow on PHP. 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.