preventing direct access to a php page, only access if redirected

前端 未结 9 1343
无人及你
无人及你 2021-01-05 11:30

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

9条回答
  •  北海茫月
    2021-01-05 12:03

    The other folks are right there are issues with $_SERVER["HTTP_REFERER"] so I guess the best way will be to have a variable set into a $_SESSION or $_POST and you will need to check if that variable exists, if not it means it is a direct access.

提交回复
热议问题