PHP

How to detect an username and password whether valid or invalid .

<?php
include(‘index.php’);
include(‘database.php’);
session_start();

$username = $_REQUEST[‘user’];//take a username from usernameΒ  field
$password = $_REQUEST[‘pass’];//take a password from password field
$result=mysql_query(“SELECT *FROM karim where name=’$username’ && pass=’$password’ “) or die(“error..”); //database query

if($username!=””&&$password!=””) {
if(mysql_affected_rows()>0){

$_SESSION[‘login_user’]=”$username”;
header(“Location:student.php”);
die();
} else {
//in-correct login
print<<<end
Your username/password is in-correct.;
end;
//$ma=”wrong username or password.”; //if any function needed this value
//return mas($ma); // return the value in function
}

}
?>

Link Exchange NET : Find Link Partners, Swap Links
Free reciprocal links directory designed to help webmasters find link partners, swap links and thus to increase web site pagerank and traffic.


Free Page Rank Tool

Advertisements
Comments
  1. yasin rakib says:

    hmmm…good also πŸ™‚ πŸ™‚

  2. karim says:

    keep it up dear…………

  3. masum says:

    Before sending your mail, if you are using variables, you must, of course, set up the variable content beforehand. Here is some simple code for sending a message:

    enjoy it ……… πŸ™‚ πŸ™‚ πŸ™‚

  4. Anonymous says:

    […] HomeAJAX (Asynchronous JavaScript and XML)DHTMLPHP […]

  5. asad saimon says:

    That’s GD~idEA…& looking gD<…..carry on……..best of luck.<

  6. Boris Purkey says:

    I don’t commonly comment but I gotta say appreciate it for the post on this special one :D.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s