meenakshidhar
Programmer
hello friends...
i want one authentication form..when user put his username and password, it will check his username and password from mysql database...if the information is correct, the next page will be displayed....
here's my coding...
<?php
if ((!$username ) and (!$password)) {
header("location: exit;
}
$db_name="meenakshi";
$table_name="authentication";
$connection=@mysql_connect( "localhost", "vivek", "tarun150" )
or die ( "Unable to connect to server." );
$db=@mysql_select_db( $db_name,$connection )
or die ( "Unable to select database." );
$sql = "SELECT * FROM $table_name WHERE
username = \"$username\" AND
password = password(\"$password\"";
$result =@mysql_query($sql)
or die("Unable to execute query."
$num = mysql_numrows( $result );
if ( $num != 0 ) {
$msg="<p>congrats</p>";
}
else{
header("location: exit;
}
?>
Can anybody plss help me...
thanks in advance...
i want one authentication form..when user put his username and password, it will check his username and password from mysql database...if the information is correct, the next page will be displayed....
here's my coding...
<?php
if ((!$username ) and (!$password)) {
header("location: exit;
}
$db_name="meenakshi";
$table_name="authentication";
$connection=@mysql_connect( "localhost", "vivek", "tarun150" )
or die ( "Unable to connect to server." );
$db=@mysql_select_db( $db_name,$connection )
or die ( "Unable to select database." );
$sql = "SELECT * FROM $table_name WHERE
username = \"$username\" AND
password = password(\"$password\"";
$result =@mysql_query($sql)
or die("Unable to execute query."
$num = mysql_numrows( $result );
if ( $num != 0 ) {
$msg="<p>congrats</p>";
}
else{
header("location: exit;
}
?>
Can anybody plss help me...
thanks in advance...