Forum Moderators: phranque
Again I find myself inside the custom error pages:
What I want:
-Generating a custom error page for 500 (ok)
-User programmes going to a 500 page when
a logical error is produced i.e. unsucessfull query execution from which php programme can't do anything
-bots, browsers, apache, knowing this fact
What I have
with:
header('location: error500.php') you get the 302 and go in for my error500.php
with:
if ($error)
header('Status: 500 blah blah...')
you get the 500, (even if you've written something: not getting the headers already sent(?)) but since it is not a real 500 (I forced it) apache doesn't notice nor error500.php redirect happens
Thanks people,
p.s.: Any other ideas are welcome about an standard error
processing system usefull to bots, logs and users
ErrorDocument 500 /err/500.php
- then put your error handling script in the "err" folder and exclude it using robots.txt if that's appropriate (i would suggest outputting a "meta robots noindex,follow" as part of the php page in stead.)
Just add the line from above to an empty ascii txt file, upload it to your homedir and name it ".htaccess" (including the dot).
/claus
<added>
hrm... i did not pay attention to this part:
>> since it is not a real 500 (I forced it) apache doesn't notice
- the above will not work then, sorry about that.
</added>
I think it's important to show an error page to the end user. Newbie users to the internet - belive me, they exist -
don't belive db updates really commit. I want them to trust my website in the following way: If I say no error occurred in the transaction u requested, please belive me, otherwise, I will notice webmaster by an email alert, and things will be checked..., This shows a lot more professional site (and it shoud be easier for the developers).
Now this output its done on a non-standarized way inside the error page using a dbman.class wich handles errors.