Re: 404 Redirection
| From: | FiShcAkE | Date: | Sun, 13 Jan 2002 16:31:32 +0000 |
| Subject: | Re: 404 Redirection | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-80638@lists.php.net to get a copy of this message | ||
Thanks Mike,
I think that is what I want to do, i'll give it a go
Thanks
Lee :-)
"Mike Cullerton" <php-l@bakednotfried.com> wrote in message
news:B866ECFC.1C4A3%php-l@bakednotfried.com...
> on 1/13/02 6:07 AM, FiShcAkE at lee.osborne@lineone.net wrote:
>
> > Try that again, without pressing ctrl-enter this time!!
> >
> > As I said, I have got the usual script:
> >
> > <?
> > if(isset($action))
> > {
> > $include = $action;
> > } else {
> > $include = "home";
> > }
> > include($include. ".inc");
> > ?>
> >
> > but, how do I put in a custom error page instead of seeing:
>
> if i understand what you are asking, you might try something like
>
> if (is_file($include. ".inc")) {
> include($include. ".inc");
> } else {
> include(custom_error.inc);
> }
>
> you may need to execute is_file($include. ".inc") inside a loop so that it
> checks in all your inlude_directories.
>
> foreach($dirs as $dir) {
> if (is_file($dir.'/'.$include. ".inc")) {
> blahblahblah
> }
>
>
> otherwise, if you know 'all' the valid files, you could create an array of
> filenames and compare $include to elements of the array.
>
> >
> > Warning: Unable to access anyotherpage.inc in
> > /var/virt/home/stuffwefound-co-uk/public_html/index.php on line 70
> >
> > Warning: Failed opening 'anyotherpage.inc' for inclusion
(include_path='') in
> > /var/virt/home/stuffwefound-co-uk/public_html/index.php on line 70
> >
> > I have got an error page for any other url i.e. apagenotfound.php but
I
> > dont know how to overcome the above.
> >
> > Thanks in advance
> >
> > Lee
> >
>
>
> -- mike cullerton michaelc at cullerton dot com
>
>