Generate 403 php error

0

Hello, I have a page in php where I wanted when the user was not logged in I would generate a 403 error and present a default page in apache. The default 403 error page is working, I just wanted to get this error in php just like I was trying to view a directory.

    
asked by anonymous 24.02.2018 / 16:56

1 answer

0

Make a comparison if the user is logged in or not, if not, set the header to the error in the output:

header("HTTP/1.0 403 Forbidden");
    
24.02.2018 / 18:22