Access Student Database Management System Templates Example. The classes menu functions to manage the students in one class. The class sub-form columns allow users to record the students’ name, major, phone number and also grade. Departments The menu departments allow users to organize the department according to the category.
Part 1This tutorial is for php beginners who already known about the fact in php and mysql database syntax. In this Part 1: We are going to create the login.php form to logging into student management website.
login.php
<form action='<?php echo $_SERVER['PHP_SELF'];?>' method='post'>
<table>
<tr>
<td>Username</td>
<td><input type='text' name='username' /></td></tr>
<tr>
<td>Password</td>
<td><input type='password' name='password' /></td></tr>
<tr>
<td> </td>
<td><input type='button' name='btnLogin' value='Login' /></td></tr>
</table>
</form>
After creating the logging form we have to validate the form using php syntax.
login.php
<?php
$error=';
if(isset($_POST['btnLogin']) and $_POST['btnLogin']='Login')
{
//Process login
$username = $_POST['username'];
$password = $_POST['password'];
include 'db.php';
$sql = 'select * from user where username='$username' and password=md5('$password')';
$results = mysql_query($sql) or die('Error on application: '.mysql_error());
$rowcount = mysql_num_rows($results);
if($rowcount>0)
{
//User Available
session_start();
$_SESSION['user']=$user;
header('Location:index.php');
}
else
{
//Invalied User
$error='Invalid Username or Password';
}
}
?>
If you give either wrong username or a password, this page gives an error as Invalid Username or Password.
<form action='<?php echo $_SERVER['PHP_SELF'];?>' method='post'>
<table>
<tr>
<td>Username</td>
<td><input type='text' name='username' /></td></tr>
<tr>
<td>Password</td>
<td><input type='password' name='password' /></td></tr>
<tr>
<td> </td>
<td><input type='button' name='btnLogin' value='Login' /><?php echo $error; ?></td></tr>
</table>
</form>
Create table called 'user' in your mysql database. Fill password column(remember to set md5 function to your password)
You want to save also the db.php file as well. Here it is.
db.php
<?php
$dbuser = 'root';
$dbpassword = ';
$db = 'students';
$host = 'localhost';
$conn = mysql_connect($host,$dbuser,$dbpassword) or die('Unable to connect to the database: '. mysql_error());
mysql_select_db($db) or die('Unable to Select the database: '.mysql_error());
?>
When after giving the username and password correclty you can log into your index page.
index.php
<?php
session_start();
if(isset($_SESSION['user']))
{
?>
#################### BODY ##############
<?php
}
{
}
- Cubersome installation. There have been a number of people asking similar questions about setting up the software. Yet no clear answers were either given in help topics or posted as FAQ. It always stopped at 'More information on OS and Apache, MySQL versions please', which is ambiguous and frustrating. Takes too long to receive support, if any.
- for sending bulk sms and in cheap rate to manage a oranization you can opt bulk sms services
- Please can someone tell me whether its username and password is 'admin' or not.I wasn,t able to login...
- Very efficient
- Easy to use and works.