PHP code only works on 1 server
| From: | PHP | Date: | Mon, 19 Mar 2007 11:52:21 +0000 |
| Subject: | PHP code only works on 1 server | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-250808@lists.php.net to get a copy of this message | ||
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@kabga.aw\">info@kabga.aw</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