[UPHPU] PHP Password Protect
Webot Graphics
graphics at westernbotanicals.com
Mon Dec 11 11:26:23 MST 2006
I want to be able to password protect a download. The page that was
built for the company has a pre formatted page which contains
JavaScript (and looks ugly to me) but they want to be able to
password protect a downloadable catalog.
I can't get the formatting to appear in this page. I am still new to
PHP so I am not sure if I am even on the right tract.
here is the link to this page. www.westernbotanicals.com/en/
whlcatalog.php. This is what a regular page looks like.
www.westernbotanicals.com/en/front.html
<?php
// Define your username and password
$username = "hello";
$password = "world";
if ($_POST['txtUsername'] != $username || $_POST['txtPassword'] !=
$password) {
?>
<HTML>
<HEAD>
<TITLE>whlcatalog.php</TITLE>
<script language="JavaScript">
<!--
// -->
</script>
</HEAD>
<BODY leftMargin=0 topMargin=0 marginwidth="0"
marginheight="0"bgcolor="993366" text="#330000" >
<!--#include virtual="/includes/mainhdr.inc" -->
<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>
\<!--#include virtual="/includes/mainftr.inc" -->
</BODY>
</HTML>
<?php
}
else {
?>
<p>This is the protected page. Your private content goes here.</p>
<?php
}
?>
Justin Giboney
graphics at westernbotanicals.com
More information about the UPHPU
mailing list