[UPHPU] PHP Password Protect

Brady Mitchell mydarb at gmail.com
Mon Dec 11 12:21:46 MST 2006


I'm not clear on what it is you are asking. If you are wondering how
to get the page to look like the rest of the site, just use whatever
site template they have for the site and insert your login form where
it needs to go.

Brady

On 12/11/06, Webot Graphics <graphics at westernbotanicals.com> wrote:
> 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
>
>
>
>
> _______________________________________________
>
> UPHPU mailing list
> UPHPU at uphpu.org
> http://uphpu.org/mailman/listinfo/uphpu
> IRC: #uphpu on irc.freenode.net
>


More information about the UPHPU mailing list