Insert Session variable into PHP form processing script
<p>I need to make sure users don't go to the download page unless they fill out the form on the register page. I need help inserting a session variable into the submission script, something like</p>

<pre><code>$_POST['authenticated']  = 'yes';
</code></pre>

<p>Then on the download page require this:</p>

<pre><code>&lt;?php
  session_start();
  if($_SESSION['authenticated'] !== 'yes') {
   header("Location: http://domain.com/default.php");
 };
?&gt;
</code></pre>

<p>I need to make them successfully fill out the form - then add it to the session - then once on the page - purge the session info but don't know how</p>

<p>I need a push in the right direction on how to require the form to be filled out in order to get to download page.</p>

<p><em><strong>EDIT</em></strong>
on purchase-registration.php (form) I added this</p>

<pre><code>$authReq=$_SESSION['authReq']=rand(1,65535);
</code></pre>

<p>and in the form(s) on that page I added this</p>

<pre><code>&lt;input type='hidden' name='authreq' value='&lt;?PHP=$authReq?&gt;'&gt;
</code></pre>

<p>In the processor script (form submit) I added this:</p>

<pre><code>"$authReq = $_POST["authReq"];"
</code></pre>

<p>and on the final page, the download-software.php which Im trying to restrict access to I added this</p>

<pre><code>&lt;?php
  session_start();
  if($_SESSION['authReq']==$_POST['authReq']) {
  header("Location: http://kinetick.com/V3/download-free.php");
  };
?&gt;
</code></pre>

<p>no joy, is this incorrect?
thx</p>
