My option is that I comment my connect class and call mssql_connect function in the page.
Now it works and still I don't know the reason why it throws an error when I use my connection class.PHP Code:<?php
session_start();
$_SESSION['name']=$_POST['name'];
#require 'connectmssql.php';
#$db=new DBConnect;
#$db->myconnect('dtr','sa','closer');
mssql_connect('xxx','sa','password');
$name=$_POST['name'];
$pass=$_POST['pass'];
mssql_select_db('hps');
$query="select empid from dtrlog where name='$name' and password='$pass'";
$r=mssql_query($query);
$empid=mssql_fetch_row($r);
$_SESSION['id']=$empid[0];
if(mssql_num_rows($r)==1){
#echo "Loading...";
$url='displaydtr.php?action=show';
header("Location: $url");
return;
}
#$db->myclose();
?>
<html>
<head><title>Confirm Log</title>
<link rel='stylesheet' type='text/css' href='mystyle.css'>
</head>
<table>
<tr><td><img src='images/newheader1.jpg'></td></tr>
</table><hr /><br /> <br /><br />
<center>
<table border='1' cellpadding='3' cellspacing='0'>
<tr class='bold'><td>User name or password is incorrect!</td>
</tr><table></center>
</html>![]()




Reply With Quote