i want to create login form having password and username and validate the username and password inserted by user with data stored in sql data base .please can you help me with the coding how to validate?

First design Login Screen, Then Connect with database and after that validation will happen... So first do these things...

I am giving Database Connectivity Code...

<?php
// Login & Session example by sde
// connect.php
// replace with your db info
$hostname="localhost";
$mysql_login="root";
$mysql_password="password";
$database="projco";
if (!($db = mysql_connect($hostname, $mysql_login , $mysql_password))){
  die("Can't connect to mysql.");       
}else{
  if (!(mysql_select_db("$database",$db)))  {
    die("Can't connect to db.");
  }
}
?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.