I need a code for log-in which will be stored as attendance for students... I am a student and i have tried so many codes but it doesn't work... i am using a mysql server for my database is it ok?

Hi van_smiles,

it actually doesn't matter which database you go for. MySQL is totally okay.

The login-in-script has to be done in a programming-language and I guess, as you are in the PHP-forum, you want to use PHP. The login is in general nothing really special.

1) You need a form that will allow the user to enter the username and password. Try something like this:

<form method=post action="login.php">
Username: <input type=text name="username"><br>
Password: <input type=password name="password"><br>
<input type=submit>

Clicking on "Submit" and the entered values will be send to login.php. So you have to create a file call "login.php" with the following code:


//fetch your data from the database here....

if($username==$dbusername && $password=$dbpassword){
echo "welcome back, ".$username;
//store a value, that confirms, that the user has logged on

If you need help how to fetch data from a database then ask here or have a look in the forum. There are plenty of tutorials that explain how to do that. I'm a bit to lazy to explain it right now.

Hope that helps for the moment. Feel free to ask if you still have problems.