View Full Version : Cause 403 error using PHP
06-18-2005, 09:51 AM
How to cause 403 error using PHP?
I used this to create 401 error in members' only Web pages.
header('HTTP/1.0 401 Unauthorized');
06-18-2005, 04:23 PM
header("HTTP/1.0 403 Forbidden");
If you have access to .htaccess files, you'd be better off controlling output that way.
This will mearly create the page, it will not validate for any security (alone that is).
06-10-2011, 06:43 AM
Thanks Fou-Lu, but i tried that on my host and it didn't actually work, so any other way? :confused::confused::confused: Thanks!! :):):)
I have an authorization required page created with php.
I want to do this: if the login fails, the page will show the 403 http error.
How to use php to show 403 http error page?
header('HTTP/1.1 403 Forbidden');
does not work.
Is it possible to use "Include" to show the error 403?
I did this :
a file with name: 403.php:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<p>You don't have permission to access <?php
?> on this server.</p>
<p>Additionally, a 403 Forbidden
error was encountered while trying to use an ErrorDocument to handle the request.</p>
and an "include" like this:
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.