RE: help me

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi
 
Check the select and update query fields spelling
 
And
 
Check this too..
$update=mysql_query("update user_login set IN_TIME='$date'where
id=$_SESSION['id']")or die("Query: Update Error".mysql_error());


Should be
$update=mysql_query("update user_login set IN_TIME='$date'  where
id=$_SESSION['id']")or die("Query: Update Error".mysql_error());


 
 
Thanks,
Muthukumar Selvarasu,
Project Manager (Web Development),
Webmasters Ltd.
From: php-objects@xxxxxxxxxxxxxxx [mailto:php-objects@xxxxxxxxxxxxxxx] On
Behalf Of gopi nath
Sent: Tuesday, January 22, 2008 6:54 PM
To: php-objects@xxxxxxxxxxxxxxx
Subject:  help me
 
<?php
ob_start();
session_start();
include("db.php");
if(isset($_POST['save']))
{
$username=$_POST['txtUserName'];
$password=$_POST['txtPassWord'];
$check=mysql_query("select Username from user_login where
Username='$username' and password='$password'") or die("Query
Error".mysql_error());
$check1=mysql_num_rows($check);
if($check1==1)
{
$_SESSION['id']=$username;
$date=date("Y-m-d H:i:s",strtotime("now"));
//$date=mysql_query("SELECT now( )")or die("Query: Date & Time
Error".mysql_error());
$update=mysql_query("update user_login set IN_TIME='$date'where
id=$_SESSION['id']")or die("Query: Update Error".mysql_error());
header("Location:success.php"); 
exit();
} 
else
{
echo "Invalid Username and Password";
exit();
}
}
?>
<!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>User Login Page</title>
<script language="javascript" type="text/javascript">
function valid()
{
if(document.frmLogin.txtUserName.value == "")
{
document.frmLogin.txtUserName.focus();
alert("Please, enter the username field");
return false;
}
if(document.frmLogin.txtPassWord.value == "")
{
document.frmLogin.txtPassWord.focus();
alert("Please, enter the password field");
return false;
}
return true;
}
</script>
</head>

<body>
<form action="" name="frmLogin" method="post">
<table align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="32" align="center">User Login</td>
</tr>
<tr>
<td><table align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="64" height="37">Username:</td>
<td width="168"><input type="text" name="txtUserName" size="20" /></td>
</tr>
<tr>
<td height="31">Password:</td>
<td><input type="password" name="txtPassWord" size="20" /></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="save" value="LogIn" onclick="return valid();"
/> <input type="reset" name="reset" value="clear" /></td>
</tr> 
</table> 
</td>
</tr>
</table> 
</form>
</body>
</html>
output:

unknown column error ya.

---------------------------------
Get the freedom to save as many mails as you wish. Click here to know how.

[Non-text portions of this message have been removed]
 


[Non-text portions of this message have been removed]


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux