When form is submitted, use the value of the submission as the url
<p>I am trying to create the following condition</p>

<p>1) User visits page
2) User enters code
3) If the code is valid, the user enters a page corresponding to the code
4) If the code is not valid, the user fails</p>

<p>This is so that people can view certain PDFs for an apartment rentals company. </p>

<p>What I would like to do, is to create a form, with an input for the special code.</p>

<p>When the form is submitted, it will simply redirect to url.com/[[value of input]].php</p>

<p>I tried creating a PHP handler to do this, but when I try it out, I get a blank page. I have limited experience with PHP, so I might be off on a completely wrong path.</p>

<p>Thoughts greatly appreciated on this </p>

<p>Here's my form</p>

<pre><code>  &lt;form id="enter_code" name="enter_code" action="code_handler.php" method="post"&gt;

        &lt;label for="code"&gt;Enter Your Apartment Code&lt;/label&gt;
        &lt;input id="code" name="code" size="30" type="text" /&gt;

        &lt;input class="button" name="commit" style="font-weight:normal" type="submit" value="Sign in" /&gt;

  &lt;/form&gt;
</code></pre>

<p>and here's my code_handler.php</p>

<pre><code>&lt;?php

   header( 'Location: http://www.opohills.com/guests/pdf/&lt;?=htmlspecialchars($_POST['code'], ENT_COMPAT)?&gt;.php' ) ;

?&gt;
</code></pre>
