Jump to content

Checking A Password


thescientist
 Share

Recommended Posts

 <?php # Script 10.1 - analogdebut_protect.php// Check for form submission:if (isset($_POST['analogdebut_submit'])){	if($_POST['password']='receptive crowd')		{			header( 'Location: http://www.analogstudios.net/analogdebut.php' );		}			else		{			echo '<p style="font-weight: bold; 			color: #C00">Incorrect passowrd, try again please.</p>';		}	} //end of main isset() If//Create the HTML form?>	  <form action="analogdebut_protect.php" method="post">	<table width="400" border="0" cellspacing="0" cellpadding="5">  <tr>	<td align="left" width="100"><h4>Password: </h4></td>  </tr>  <tr>	<td><input type="text" name="password" 	size="25" maxlength="80" value="<?php if	(isset($_POST['password'])) echo $_POST['password']; ?>" /></td>	<td colspan="1"><input type="submit" name="submit" value="Sign Up!"/>	  <input type="hidden" name="analogdebut_submit" value="analogdebut_status"/>	</td>	</tr></table>		</form>

on this page here I am trying to use the above code to redirect someone based on them supplying the correct password. The redirect works ok, but I'm not sure how to add a conditional statement based on their input. I'm sure it's something really simple. Thanks in advance!

Link to comment
Share on other sites

got it! :)actually, could anyone explain why it pops up in it's own tab, as opposed to just replacing the page it's coming from?if you go here and click on the "Analog Studios exclusive" link, it opens the password page in it's own tab.

Edited by thescientist
Link to comment
Share on other sites

EDIT: i posted before i saw your edit, and thought you were talking about after inputting the password...anyway:<a href="analogdebut_protect.php" target="new">try removing the target="new"?

Edited by smerny
Link to comment
Share on other sites

wow, figures. It's only after I post a question does it work... :)

Edited by thescientist
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...