By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,746 Members | 1,928 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,746 IT Pros & Developers. It's quick & easy.

404

The1corrupted
100+
P: 134
Quick question, how do you get a 404 error using PHP? (for security purposes)
Feb 21 '07 #1
Share this Question
Share on Google+
5 Replies


Motoma
Expert 2.5K+
P: 3,235
[PHP]
<?php
header("HTTP/1.0 404 Not Found");
?>
[/PHP]
Feb 21 '07 #2

The1corrupted
100+
P: 134
Cool, thanks.
Feb 21 '07 #3

Motoma
Expert 2.5K+
P: 3,235
Cool, thanks.
Glad to help.
Feb 21 '07 #4

The1corrupted
100+
P: 134
What happens if we have an error page we would like to use?
May 29 '07 #5

Motoma
Expert 2.5K+
P: 3,235
What happens if we have an error page we would like to use?
This depends on what type of server you are running on. Typical web-hosting companies will allow you to specify your own error documents, Apache and IIS both let you configure them yourself. If you wanted to append a the document to the php code above, that works as well.
May 29 '07 #6

Post your reply

Sign in to post your reply or Sign up for a free account.