tags:

views:

10

answers:

0

Ok, with some help I got this to work. I needed to restrict access to "download-software.php" to users who came from "download-registration.php" - a form that's action, if the form validates sends you to "download-software.php" with this: on "download-registration.php"

<?php
  session_start();
  $_SESSION['authenticated'] = 'yes';
?>

and this on "download-software"

<?php
  session_start();
  if($_SESSION['authenticated'] !== 'yes') {
  header("Location: http://kinetick.com/V3/download-free.php");
  };
?>

I need some help improving on this in a couple ways. "#1" is there a way to set $_SESSION['authenticated'] = 'yes'; only on form submission? would you just set it as a value in the PHP form processing script?

"2" Could I set a timestamp on the first page and on the second page check to make sure its happening on the same day and if its not the same day return it to the start page?

Thanks!