This is basically dreamweaver code for login section. Dont be panic if you cant understand most of stuffm, only view basic code that is mark up. This is for login section in which if username and password from mysql table admin are not mathced than it gives error as by get method. I dont write code fully here.
<?php require_once('../Connections/mycon.php'); ?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}
$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}
if (isset($_POST['username'])) {
$loginUsername=$_POST['username'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "donor.php";
$MM_redirectLoginFailed = "index.php?invalid=1";
$MM_redirecttoReferrer = false;
mysql_select_db($database_mycon, $mycon);
$LoginRS__query=sprintf("SELECT uername, password FROM admin WHERE uername='%s' AND password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));
$LoginRS = mysql_query($LoginRS__query, $mycon) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";
//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;
if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<?php if(isset($_GET['invalid']) && $_GET['invalid']==1) { ?>
<table>
<tr class="box">
<td colspan="2" bgcolor="#FFFFCC"><div align="center"><span style="color:#FF0000; font-size:14px;" >
<?php echo "Invalid Username/Password."; ?> </span></div></td>
</tr>
</table>
<?php } ?>