Insert Session variable into PHP form processing script

anas_eqal

New Member
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\[code\]$_POST['authenticated'] = 'yes';\[/code\]Then on the download page require this:\[code\]<?php session_start(); if($_SESSION['authenticated'] !== 'yes') { header("Location: http://domain.com/default.php"); };?>\[/code\]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 howI need a push in the right direction on how to require the form to be filled out in order to get to download page.EDITon purchase-registration.php (form) I added this\[code\]$authReq=$_SESSION['authReq']=rand(1,65535);\[/code\]and in the form(s) on that page I added this\[code\]<input type='hidden' name='authreq' value='http://stackoverflow.com/questions/3909183/<?PHP=$authReq?>'>\[/code\]In the processor script (form submit) I added this:\[code\]"$authReq = $_POST["authReq"];"\[/code\]and on the final page, the download-software.php which Im trying to restrict access to I added this\[code\]<?php session_start(); if($_SESSION['authReq']==$_POST['authReq']) { header("Location: http://kinetick.com/V3/download-free.php"); };?>\[/code\]no joy, is this incorrect?thx
 
Back
Top