Ok, so would my page structure look like this:
Code:
<!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" />
<script type="text/javascript" language="javascript" src="javascript.js"></script>
<link rel="stylesheet" type="text/css" href="css.css" />
<?php
// Define your username and password
$username = "Some Name";
$password = "somepassword";
$theName = isset($_POST['txtUsername'])? $_POST['txtUsername'] : '';
$thePass = isset($_POST['txtPassword'])? $_POST['txtPassword'] : '';
if ($theName != $username || $thePass != $password) {
?>
<title>Login for Whatever</title>
<h1>Login</h1>
<form name="form" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<p>Username:
<br><input type="text" title="Enter your Username" name="txtUsername"></p>
<p>Password:
<br><input type="password" title="Enter your password" name="txtPassword"></p>
<p><input type="submit" name="Submit" value="Login"></p>
</form>
<?php
}
else {
?>
<title>Secret Area</title>
</head>
<body>
<p>Hello, this is the content.</p>
<?php
}
?>
</body>
</html>
Bookmarks