Forum Moderators: coopster
And then when he get on the pc and opens this page he gets on the main page?
How is that done?
<?php
$connection = mysql_connect("localhost", "root", "") or die("Cannot connect to MySQL server: " . mysql_error());
$db_selected = mysql_select_db('tmetrix', $connection);
session_start();
$username = $_POST['username'];
$password = ($_POST['password']);
$query = "select * from users where username = '$username' and password = '$password'";
$result = mysql_query($query);
if (mysql_num_rows($result) != 1) {
$error = "Bad Login";
include "login.html";
} else {
$_SESSION['username'] = "$username";
header("location:main.php");
}
?>