// login.php page
<?php
include_once("dba.class.php");
$msg="";
if(isset($_POST["btnLogin"])){
$username=trim(mysql_real_escape_string($_POST["txtUserName"]));
$password=trim(mysql_real_escape_string($_POST["txtPassword"]));
if($username != "" or $password != ""){
$c->LoginAdmin($username,$password);
header("location:Admin.php");
}
else
$msg="Invalid User Name or Password";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Login Page</title>
<style type="text/css">
.MSG {
color: #F00;
}
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="300" border="0" align="center" cellpadding="2" cellspacing="0">
<tr>
<td colspan="2"><strong>Login Page</strong></td>
</tr>
<tr>
<td width="95"> </td>
<td width="247" ><?php echo $msg ?></td>
</tr>
<tr>
<td>User Name:</td>
<td><input type="text" name="txtUserName" id="txtUserName" /></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="password" name="txtPassword" id="txtPassword" /></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="btnLogin" id="btnLogin" value="Login" /></td>
</tr>
</table>
</form>
</body>
</html>
//db_class page
<?
class dba{
public function __construct()
{
$conn = mysql_connect("localhost","root","root");
mysql_select_db("db",$conn);
}
function LoginAdmin($username,$password){
$sql=mysql_query("select * from userinfo where userinfo.username='$username' and password='$password'");
return $sql;
$rs=mysql_fetch_array($sql);
}
}
$c= new dba();
?>
I got this error"!Fatal error: Class 'dba' not found in C:\wamp\www\Login.php"
what should i do, please?