Script Redirecting Even when valid
<p>This is a little script that supposed to redirect if someone came from a different page, but it's does not work. 
It keeps redirecting to the form page.</p>

<p>Here's the code</p>

<pre><code>&lt;?php

define('FORM', 'form.html');
$referer = $_SERVER['HTTP_REFERER'];

// this keeps redirecting even when I came by submiting the form to this page
if ( $referer != FORM ) {
   header('Location: ' .FORM);
}
?&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
&lt;title&gt;Testing 123&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;
  &lt;?php
        $name  = $_GET['name'];
        $surname  = $_GET['surname'];
        echo 'hello'. $name. 'nice to see you here mr' .$surname;
    ?&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
