I would use a SWITCH statement. If you don't know, it is like using multiple IF statements. Here is an example:
<?php
$inputBox = $_POST["inputBoxTitle"];
SWITCH ($inputBox) {
CASE "test1":
$handle = fopen("/test1.php", "r");
BREAK;
CASE "test2":
$handle = fopen("/test2.php", "r");
BREAK;
CASE "test3":
$handle = fopen("/test3.php", "r");
BREAK;
DEFAULT:
header("Location: http://www.google.com/search?hl=en&q=" . $inputBox . "");
}
?>
Save that as submit.php
Your main page would have a form with an input box called inputBoxTitle. The action for the form would be submit.php. So, a basic example would be:
<form action="submit.php" method="POST">
<input name="inputBoxTitle" />
<input type="submit" value="Submit" />
</div>
</form>
Here's how submit.php works:
Firstly, it takes the output from the input box and calls it $inputBox.
A CASE statement is used for each positive possibility. This uses fopen to open a page on your site.
The DEFAULT code for a SWITCH statement determines what happens if no CASE statement is met. In our example, it redirects to Google and searches for whatever was put in the box.
By the way, I'm learning myself, and so I don't know if I did this the best way, but it works in my simple example. fopen doesn't seem to work for external URLs (I couldn't get it to, anyway), so I used header instead. Please note that you MUST NOT have an <html> tag BEFORE that header, or it won't work!