login script problem :D
mooo, made my first login script lol.
nothing connected to Database but it's my first try :D k, it's located here: http://albsky.110mb.com/login details: voorbeeld voorbeeld K, it works, it redirects you to 'usercp.php'. But, you can go to usercp.php without logging in as well! How do I let it require to be logged in? What is the code? A new session or what? what ^^ Can someone read the codes and tell me what to add/change/whatever :D Codes from the 3 files; ---Index.php--- Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ---login.php--- Code:
<?php ---UserCP.php--- Code:
<? |
You don't have to start a session in UserCP if you've already started one in login.php (cause you're including that).
login.php Code:
<?php UserCP.php Code:
<? |
hmm, I can still enter it without 'logging in' and when I log in I can't see it.
I've tried making the 'true' in usercp to 'false' and 'die' to 'exit'. But in this way it doesn't work =S, you have any other suggestions :D:D:D |
well yeah lol...
Code:
<? |
doesn't work, the problem is that it requires login.php which in some way makes you login again, so you login over and over and over again :P
|
You guys, I've already told Albsky on Shoutbox, that he shouldn't do it this way. Login script is 1 thing, and another is auth check. Algorithm should work this way:
1. Check if user is authenticated YES - go on, NO - send him to login script. If you load login.php script before checking it it's just not working. IMAO the prettiest and still easy way to do this would be: (lol, i've pressed post, instead of go advanced :signIRULE: ) Code:
function authcheck() { Ok, now that is working: Code:
<? |
Yeah lol, that would probably do the trick. xD
I tried editing his code which is a bit harder... :P |
All times are GMT -5. The time now is 04:12 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2006 - 2019 Twilight MU. All Rights Reserved