connect.php
Code: Select all
<?php
$connect = mysql_connect ('localhost','dbaccess','only');
mysql_select_db('backuplog', $connect);
?>
Code: Select all
<?php
include "connect.php";
$sql = "select name from user where login='$id' and password='$password' ";
$result = mysql_query ($sql, $connect);
$row = mysql_fetch_array($result);
$username = $row[name];
if($row)
{
echo ("
<body bgcolor='white'>
Name: <font color='red'> $username</font>
</body>
<br><br><meta http-equiv='refresh' content='2; url=tempager.php'>
");
}
else {
echo ("
<html>
<head><title></title>
<meta http-equiv='refresh' content='0; url=login.html'>
</head>
<body bgcolor='white'>
</body>
</html>
");
}
?>
Code: Select all
<?php
echo include "login.php";
echo ("
Name: <font color='red> $username</font>
");
?>