Generate error 403 php

Asked

Viewed 439 times

0

Hello, I have a php page where I wanted when the user was not logged in to generate a 403 error and present a default page in apache.
The default 403 error page is working, I just wanted it to error in php as if I tried to view a directory.

1 answer

0


Compare whether the user is logged in or not, if you are not setting the header for the exit error:

header("HTTP/1.0 403 Forbidden");
  • Hello, even though it does not show the error page I set, could give me another solution?

  • Try pointing out the error and include an error page; include '/errors/403.php', Obs: create this folder/page at the root of your directory

Browser other questions tagged

You are not signed in. Login or sign up in order to post.