Page linking help

So, i am trying to make a web application by using php.

I need to find a way that you get directed to a page by putting in a code into an inputfield.

<?php if ($input == "20") { ???????????????????? } ?>

For example here you see a basic if function where it needs to direct to a page when the number 20 has been typed in.

I would apprieciate some help!
Tanks! :smiley:

thats not a function. a function would look like
[php] function redirect ($input) {
if($input == 20) {
header (“Location: page.html”);
}
}[/php]

Put this in the page where you want it to show

[php]$actions = array( ‘home’ => ‘index.php’,
‘10’ => ‘login.php’,
‘20’ => ‘register.php’,
‘30’ => ‘newsform.php’,
‘40’ => ‘news.delete.confirm.php’
);

if(!isset($_GET[‘input’]) || !array_key_exists($_GET[‘input’], $actions))
$_GET[‘input’] = ‘home’; // set a default

include($actions[ $_GET[‘p’] ]);[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service