How to let User enter a Code and have it call a specific page

Basically I want a User to be able to enter a code they have been given and when submitted it will bring them to a specific page. There will eventually be a hundred or so of these codes/pages.

Not even sure where to start??

Hi,
You could store in database the code and page. The code in one table column, and the page associated to it in other column.
Then, with $_GET you get the code from url, select row withthat code in database, get the page, and redirect with: header(‘Location: page_url’);

Another way would be to maintain an array of elements.



$redirects = array( 
"abc123"=>"this_page",
"xyx890"=>"that_page",
);

$incoming = "abc123"

if( array_key_exists($incoming, $redirects)){

header("Location: /somefolder/" . $redirects[$incoming] . ".php" );
exit();

}


Essentially the same thing as MarPlo suggests, but with the upside you do not have to query a database, but the downside you have to maintain an array by hand.

The $redirects array could be kept in another file and [fphp]include[/fphp]d, especially useful if you have a subsequent places that need access to that array.

Start from Google perhaps!
There are also too many sites offering code snippets. Search 'em down.

Just Google - “Code Snippets
https://www.google.co.in/search?q=code+snippets