thanks for your response, so now i have goo2.php and STPD.html
now i'm trying to have users log in function(*users.php)* in my project,
user can view task own department after enter their own username and
password,
How to link between users.php and STPD.html.
Sorry For My Bad English ><''
*Users table*
*id | username | password |*
* 1 AAA 111*
* 2 BBB 222*
* 3 CCC 333*
* 4 DDD 444*
*
*
*STPD Table*
*id | Department | number_worker*
* 1 X 16*
* 2 Y** 10*
* 3 Y** 15*
* 4 Z** 20** *
*
*
*
*
*users.php*
<?php
$host ="localhost";
$user ="root";
$pass = "";
$db = "ecom";
mysql_connect($host, $user, $pass);
mysql_select_db($db);
if (isset($_POST['username'])){
$username = $_POST['username'];
$password = $_POST['password'];
$sql="SELECT * FROM users WHERE username='".$username."' and
password='".$password."' LIMIT 1";
$result = mysql_query($sql);
if (mysql_num_rows($result)==1){
header("location:STPD.html");
exit();
}else{
echo "Invalid login information. Please return to the previous page.";
exit();
}
}
?>
<html>
<head>
<title>Main Login Page</title>
</head>
<body>
<form method="post" action="users.php">
Username:<input types="text" name="username" ><br />
Password:<input types="text" name="password" ><br />
<input type="submit" name="submit" value="Log In" />
</form>
</body>
</html>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.