thescientist Posted June 14, 2009 Share Posted June 14, 2009 <?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 More sharing options...
thescientist Posted June 14, 2009 Author Share Posted June 14, 2009 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. Link to comment Share on other sites More sharing options...
smerny Posted June 14, 2009 Share Posted June 14, 2009 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"? Link to comment Share on other sites More sharing options...
thescientist Posted June 14, 2009 Author Share Posted June 14, 2009 wow, figures. It's only after I post a question does it work... Link to comment Share on other sites More sharing options...
thescientist Posted June 14, 2009 Author Share Posted June 14, 2009 woops, didn't realize I forget to upload the changed page to the server. Just call me Mr. Dumas... Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.