A
Anonymous
Guest
You could do something like setting a session variable on the page you're linking from, and checking for it at the top of your php page. If it's not set, you send a header to point the user back somewhere else. Then you unset it if you don't want the user to be able to come right back to that page in the same session.
Code:
session_start();
if (empty($_SESSION['referrer']))
{header("Location: index.php");
exit();}
unset($_SESSION['referrer']);