[UPHPU] PHP Password Protect

Webot Graphics graphics at westernbotanicals.com
Tue Dec 12 13:03:17 MST 2006


So I tried putting it into a html page and now the layout looks  
correct except the php doesn't seem to be working     
www.westernbotanicals.com/en/whlcatalog.html


<HTML>
<HEAD>
<TITLE>front.html</TITLE>
<script language="JavaScript">
<!--
// -->
</script>
</HEAD>
<BODY  leftMargin=0 topMargin=0 marginwidth="0"  
marginheight="0"bgcolor="993366" text="#330000"  >
<!--#include virtual="/includes/mainhdr.inc" -->
                 <?php
// Define your username and password
$username = "hello";
$password = "world";
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] !=  
$password) {
?>
<h1>Login</h1>
<form name="form" method="post" action="<?php echo $_SERVER 
['PHP_SELF']; ?>">
     <p><label for="txtUsername">Username:</label>
     <br /><input type="text" title="Enter your Username"  
name="txtUsername" /></p>
     <p><label for="txtpassword">Password:</label>
     <br /><input type="password" title="Enter your password"  
name="txtPassword" /></p>
     <p><input type="submit" name="Submit" value="Login" /></p>
</form>
<?php
}
else {
?>
<p>This is the protected page. Your private content goes here.</p>
<?php
}
?>
                   <!--#include virtual="/includes/mainftr.inc" -->
</BODY>
</HTML>


Justin Giboney
graphics at westernbotanicals.com




More information about the UPHPU mailing list