ok. Here is my code, maybe someone else will benefit.
Script A (where the user comes from) includes:
$script_pass = 'ok';
session_start();
session_register("script_pass");
Script B (where the user goes and only displays to people from Script 😎
if ($_SESSION["script_pass"] == TRUE) {
echo 'Welcome';
$script_pass = '';
session_start();
session_register("script_pass");
} else {
echo 'You are not welcome.';
}
The session for script_pass needs to be cleared or it will remain and the user could access Script B from anywhere. I store sessions in the local file, but if you give it to the user via a cookie or something like that, the_Igel raises a good point --- md5 would be a good thing.