PHP page only accessible from another page redirect and prevent my user from accessing it directly.
you can use define()
and defined()
to prevent it from being directly loaded.
In the Main page which contains redirection write
1 2 3 |
<?php define('MAIN_INCLUDED', 1); ?> |
On other page say nodirectaccess.php
1 2 3 4 |
<?php if(!defined('MAIN_INCLUDED')) header("location:house-owner-signup.php"); ?> |