Hi, I don't know that you are the new in with PHP, but if you new in that then you first clear all basic concept about that language,
Client side scripting language [HTML,CSS,JAVA - SCRIPT]
Server side scripting language [PHP].
Because according to my personal exp. you will become a good developer, when you clear all basic concept that's help you for creating any web-development,
Now I share My Code that's Definitely Help you.
File save path: C/D/E/F: Drive => wamp => www => login folder(You Create) => index_dir.php
Database Name we used:dir_db
Table Name we used :dir_login(With Two Attribute, username, password)
Code:

<?php
if(isset($_POST['posted']))
{
$name=$_POST['dir_username'];
$pass=$_POST['dir_password'];
$connect=mysql_connect('localhost','root','');
$db=mysql_select_db('dir_db',$connect);
$query=mysql_query('SELECT * FROM dir_login',$connect);
while($row=mysql_fetch_array($query))
{
$column1=$row['username'];
$column2=$row['password'];
if($column1 == $name && $column2 == $pass)
{
header('location:registration_dir.php');
}
else
{
echo('Sorry Username and password is mismatch');
exit();
}
}
}
?>
<form name="index_dir" method="post" action="index_dir.php">
<table align="center" border="">
<tr>
<td>
<b style="background-color:#063">USERNAME</b>
<input type="text" name="dir_username" value="USERNAME" style="background-color:#966">
</td>
</tr>
<tr>
<td><b style="background-color:#063">PASSWORD</b>
<input type="password" name="dir_password" value="*****" style="background-color:#966">
</td>
</tr>
<tr>
<td><input type="hidden" name="posted" value="true>"></td>
<td>
<input type="submit" name="dir_submir" value="GO" style="background-color:#063">
</td>
</tr>
</table>
</form>
Technology use:
Server: localhost
Database System: MySql[phpmyadmin client].
Editor: Adobe Dream Weaver.
and still you have doubt then either mention here or visit w3schools.com.
