Jump to content

Only run script if page was accessed via index.php


joecooper

Recommended Posts

Use sessions -- much more reliable than the http_referer

 

In the index.php script:

<?php
session_start();
$_SESSION['coming_from'] = 'index.php';
?>

In the second script:

<?php
session_start();
if ($_SESSION['coming_from'] != 'index.php') header('location: index.php'); //put them back to index.php
?>

 

Ken

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.