I want to make my php page only accessible from another page redirect and prevent my user from accessing it directly.
I mean, let\'s say I have a page called
I think you're probably coming at the problem from the wrong direction, but if you really want to implement this I'd most likely do it with a session variable. Just have main.php set a flag indicating that they're now able to access noaccess.php and then redirect there. noaccess.php checks for the flag, and only functions if it's been set.