Error Page Handling with Apache

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Error Page Handling with Apache

Post by Skara »

Don't know if this would go here or in the Apache forum.
In any case, here's the deal. I'd basically like to add a line like this:

ErrorDocument 404 /error/all.php?code=404

Now the only way I can think of to do something like this is to do it the opposite way. Have a top and bottom file and include those from the 404.php page.
If I have to do this, so be it, but I was hoping there'd be a better way to pass a variable somehow. Ideas?
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Post by artexercise »

can you pass an error inside form tags and use <input type="hidden" name="errorCode" Value="404">? And then check _POST in the subsequenet page?

JOE--
User avatar
Skara
Forum Regular
Posts: 703
Joined: Sat Mar 12, 2005 7:13 pm
Location: US

Post by Skara »

I don't really see what you mean. My question is how would I pass a variable to a file through httpd.conf.
User avatar
artexercise
Forum Commoner
Posts: 33
Joined: Thu Nov 20, 2003 9:38 am
Location: Raleigh, NC

Post by artexercise »

oops I misunderstood.

httpd.conf

Code: Select all

ErrorDocument 404 /all.php
Somewhere at the beginning of all.php

Code: Select all

$server_error_type = $_SERVER&#1111;'REDIRECT_STATUS'];
This might work. Beyond this, I'd try your idea. :)

JOE--
Post Reply