![]() |
Simple error manager
PHP Code:
|
Quote:
|
Or you could just set your Error 404 page to a page with a QueryString, mod_rewrite wouldn't be needed at all.
|
Quote:
|
but the point is, if you didn't have HTACCESS at all, then you wouldn't be able to define error pages in the normal way, and if you do, you can define the error pages, so I dont see the problem.
weazel, out of interest, how do you use this on your website (if you use it at all). |
ErrorDocument 404 /error.php?type=404
etc.... If you don't have access to .htaccess, you can't use it. The only reason I said IIS in my original post is because I believe you can define custom error pages from inetmgr (and some windows hosts support PHP) |
neat! ...slightly off subject reply, here
thats pretty cool...
diving into php here, and as simple as that snippet is i think it just made a couple things a little more clear for me... thanks... ALSO.... (prolly not the place to put this but, i stumbled across it searching for an answer so i thought id risk postin it...) On the subject of PHP and Error handling.... can't ya do this little JS error tailoring action server side in a pretty simple fashion so as to avoid the shortcommings of <noscript>? (sry to post basically a question in here, but i thought if that was touched on it might make this thread even more great!) |
Thats true. But what if your APACHE doesn't allow you to change error pages? For example I have a free PHP host that allows .htacces and mod_rewrite but adding 404 pages just dissapear because they have they're own. Using mod_rewrite you can still achieve the same result.
Also if you don't have APACHE at all, or don't have access to it you can still use it if you have a dynamic include functions. If the file doesn't exist, you simply include the proper error instead. :) There are plenty of ways to use this without APACHE as even some scripts have they're own defined 404 pages which can be altered to this script as well. The only problem with this is, you don't really need the manager considering if you are doing things for the site it would usually only be a 404 error, all other errors will still be handled by the server if you don't have APACHE and define the new pages. |
Ok, so in your case mod_rewrite would be the best option, but its still basically the same principle as the error document except that mod rewrite doesnt mark documents as errors... The browser assumes everything is ok, so you should then send HTTP headers in the PHP script.
|
| All times are GMT +1. The time now is 08:35 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.