Hi, I don't know if this is the correct title, please accept my apology. I have an index.php (main page) and content.php (my content) page. If visitor visiting my website, when they return they simply click on the url bar and go to the content.php bypassing index.php My question is how to block user from directly viewing my content at content.php and redirect them to index.php. Only after they click a link on index.php they will be redirect to content.php. eg: at index.php: click here to view content and they will be redirect to content.php I already use javascript but when I turn off my javascript browser my website does not redirect so I think php might help... Thanks in advance
Use Session, set a variable in index.php and test if the variable is present in content.php, if content.php doesn't detect the session variable - do a redirect to index.php
Hi, Simple example using sessions. Index.php (at the top) session_start(); $_SESSION["first_time"] = 1; PHP: Content.php (at the top, before all code) if($_SESSION["first_time"] != 1) { header("Location: index.php"); } PHP: Regards, Steve