WatsonN Posted September 11, 2010 Share Posted September 11, 2010 I have a login script that pulls from a DB and in that i have a column called "Allowed" that either has a 0 for not allowed or a 1 for allowed. How would I implement that into a login script to either allow the login or die? Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted September 11, 2010 Share Posted September 11, 2010 I am pretty sure just like an ordinary login script. All you need is an extra column in your table with approved and an extra if clause in your login script that checks if the value of approved is 1 Quote Link to comment Share on other sites More sharing options...
BizLab Posted September 11, 2010 Share Posted September 11, 2010 I am pretty sure just like an ordinary login script. All you need is an extra column in your table with approved and an extra if clause in your login script that checks if the value of approved is 1 right on the money. if($approved==1){ // let me login } else{ // tell me why i can't } the value for the approved var is pulled from the Db when querying for the user info Quote Link to comment Share on other sites More sharing options...
fortnox007 Posted September 11, 2010 Share Posted September 11, 2010 additionally you could leave this part out on there profile page, so people can edit there profile and already do something. Which is not visible unless they are approved You might not want to do this, but it can be something to keep in mind. for instance If you let them pay for something, but they first have to be checked out if they qualify or something like a chamber of commerce integrity check thing. This is also a nice extra because this way you can only display content from users that are approved. (in case someone breaks the rules all his post will not show up) Quote Link to comment Share on other sites More sharing options...
WatsonN Posted September 11, 2010 Author Share Posted September 11, 2010 Thank ya fortnox007. After I read that i was like here it is. //gives error if not allowed if ($info['Allowed'] != "1") { $error = 'You are not allowed to login. Please activate your account.'; setcookie("Errors", 0, time()-3600); setcookie(Errors, $error, time()+5); ?> <BODY onLoad=window.setTimeout("location.href='/'",0)> <?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.