Add additional checking
Hi
I am new to php & mysql database. I am doing a project on Login with username, password and verification with an additional field - Approval. Instead of just allowing someone to login with the username and password, an additional verification field (Approval) is carried out to check if this account has been approved with data indicating as 'YES' from the database. Would appreciate if someone can help to resolve or point to me where I can get an example of solving this problem. Thanks ! |
This is an example, modified from something I used on a site. I used an "active" column in my database for which could be "approved" in your case...
Code:
<?php |
Hi
Is it possible to give the entire login example. I am still new with this. Thanks! |
What else do you need?
|
Hi
I tried to use your example but it simply echo both the User and the Guest. Therefore wondering the complete script for login. Thanks! |
Here is the login form which goes below what I previously sent. Sorry that is a bit messy.
Code:
<?php |
Hi juanbobo
Thank you for the code. I have tried combining both codes together but do not seem to get it working for the verification as it prompt Login invalid. If it is not too much to ask, can you show the complete working example? Thanks! |
Hi
I know the login for the database but can't seem to figure out how your code works with my table. Basically my table consists of only UserID, Password and Approval (Yes or No). How do I input this with your code? Thanks! My login code is: Code:
include("config.php"); |
Here you can read about HTML forms, just create a form with three fields for username, password, and approval...
http://www.w3schools.com/html/default.asp http://www.php.net is a great reference for PHP commands such as those related to MySQL. Look up the command mysql_fetch_array(), you can use it to access data for your database. You have null for the host, I would use "localhost". |
Hi
I need the php login with username and password but with a hidden checking as whether that user is approved or not that denotes by Yes or No field. As I am just a beginner, I really need help to have the php code how I can do it. Do you know how to write the code? Thanks! |
All times are GMT -5. The time now is 10:55 PM. |