[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     

<script language="JavaScript">
// -->
<BODY  leftMargin=0 topMargin=0 marginwidth="0"  
marginheight="0"bgcolor="993366" text="#330000"  >
<!--#include virtual="/includes/mainhdr.inc" -->
// Define your username and password
$username = "hello";
$password = "world";
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] !=  
$password) {
<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>
else {
<p>This is the protected page. Your private content goes here.</p>
                   <!--#include virtual="/includes/mainftr.inc" -->

Justin Giboney
graphics at westernbotanicals.com

More information about the UPHPU mailing list