How to I make an input box in php?

  • Thread starter Thread starter Nick M
  • Start date Start date
N

Nick M

Guest
I want an input box that when you type in a certain word, it brings you to another page. If you get the word wrong, it brings you to another page.
(such as the ones on thisisnottom.com/lic2ill.php), how would I do this using php so a person cant see the input needed to go to the correct page?

Thank you,
Nick
 
One page with:
<form action="page2.php" method="post"><input name="word" type="text" /> <input type="submit" value="Go" /></form>

Then page2.php with:
if($_POST[word] = "wordYouWant")
{
header('Location: page3.php');
}
else
{
header('Location: page4.php');
}

You can also just put the content in the if and else itself.
 
One page with:
<form action="page2.php" method="post"><input name="word" type="text" /> <input type="submit" value="Go" /></form>

Then page2.php with:
if($_POST[word] = "wordYouWant")
{
header('Location: page3.php');
}
else
{
header('Location: page4.php');
}

You can also just put the content in the if and else itself.
 
Back
Top