Re: PHP code only works on 1 server

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



PHP wrote:
Dear All,
I wrote a simple PHP 404 handler (index.php)(see the code below) to catch
missing pages for instance. But it only works on 1 server and not the other.

This is the server where it works:
My Server:
http://www.orbitalnets.com/support/info.php

This is the server where it won't work (which is the server where it should
work):
Setarnet:
http://www.kabga.aw/info.php

Could it be the version difference? How should it be coded to work on all
php servers?



Here is the code of the index.php file.

<?php
 $errormsg .= "<div align=\"center\"><a
href=\"http://www.kabga.aw/nl/index.php\";><img
src=\"images/body/logo-kabga.gif\" width=\"215\" height=\"49\"
border=\"0\"></a> </font></strong>";
 $errormsg .= "<strong><font color=\"#333333\" size=\"-1\" face=\"Verdana,
Arial, Helvetica, sans-serif\"><br>";
 $errormsg .= "404 File not found<br><br><br><br><a
href=\"mailto:info@xxxxxxxx\";>info@xxxxxxxx</a><br><br>";
 $errormsg .= " Tel: +297 582-4455<br>Fax: +297 582-2018<br><br></div>";
 $navsignthing = "$page";
 $extension = "php";

if(file_exists("$navsignthing.$extension"))
{
include "$navsignthing.$extension";
}
elseif($navsignthing=="")
{
include "default.$extension";
}
else
{
echo "$errormsg";
}
?>


Please let me know,

Dwayne Heronimo

This isn't a php issue but an apache issue. Have you checked to make sure that apache redirects the 404 to your custom error message?

 http://httpd.apache.org/docs/2.2/mod/core.html#errordocument

--

_____________________
Myron Turner
http://www.room535.org
http://www.bstatzero.org
http://www.mturner.org/XML_PullParser/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux