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
$_POST['authenticated'] = 'yes';
Then on the download page require this:
<?php
session_start();
if($_SESSION['authenticated'] !== 'yes') {
header("Location: http://domain.com/default.php");
};
?>
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
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.
EDIT
on purchase-registration.php (form) I added this
$authReq=$_SESSION['authReq']=rand(1,65535);
and in the form(s) on that page I added this
<input type='hidden' name='authreq' value='<?PHP=$authReq?>'>
In the processor script (form submit) I added this:
"$authReq = $_POST["authReq"];"
and on the final page, the download-software.php which Im trying to restrict access to I added this
<?php
session_start();
if($_SESSION['authReq']==$_POST['authReq']) {
header("Location: http://kinetick.com/V3/download-free.php");
};
?>
no joy, is this incorrect?
thx
The way I usually handle that is:
on the page that renders the form:
on the form:
and on the submitted page
….if($_SESSION['authReq']==$_POST['authReq'])