+ Reply to Thread
Results 1 to 4 of 4

Thread: problem displaying error page

  1. Join Date
    Nov 2005
    Posts
    3

    problem displaying error page

    When a search is conducted without domain name or extension, I get the error page without the header, footer and menu of my page.
    I am using whois.php as an include on my page.
    Everything works fine except that when it shows error, other page elements of my page are not shown.
    Also if you could tell where to find the code that displays whois info. I have to shift the whois info a little away from the left margin, but can't find it.
    And script is really the best. I tried many scripts but this one does everything that is really required!

  2. Join Date
    Aug 2004
    Posts
    781

    problem displaying error page

    The first problem, involving your own page's content not being displayed (header / footer) is a result of the script using a hard die() function in PHP on errors. This is most definitely a problem that does not flow well and will be fixed in the future. I would post an update right now, but it requires some extensive modifications (previous single line statements need to be made into if statements, empty data returns must be accounted for, etc...). The die() results in PHP being stopped altogether, thus includes, etc, are not displayed.

    There is something you could do for it though, but it results in dropping alot of hard code into the script (as opposed to, for example, the template being a variable).

    Open up whos/global.php and find:
    Code:
    die();
    Before that line, you need to add in everything that comes after your whois.php include line (DO NOT copy the whois.php include as this will cause the script to include itself and crash ~ and anger your host).

    For example, if your page was:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>MyWebsite</TITLE>
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>
    
    <BODY>
    <?php include("some/header/file.php"); ?>
    <?php include("path/to/whois.php"); ?>
    <?php include("some/footer/file.php"); ?>
    </BODY>
    </HTML>
    Then you would copy the following into global.php above "die();":
    Code:
    include("some/footer/file.php"); ?>
    </BODY>
    </HTML>
    <?
    NOTE: Note how I fixed the <? and the ?> to reflect whether the text was PHP or not. The "die();" in the global.php file is obviously live PHP code, so you will need to stop the PHP execution with ?> if you are copying in static HTML code (and don't forget to begin the PHP code again for the die() function after you are finished copying with a <? )

    Confusing? You bet. Although it is the best solution at the moment. I will try to release an update sometime soon with updated code that fixes this without the need to modify hard code.

    If you still need help with this problem, copy the page's html / code that you are using for the Whois Script (the one that is including whois.php) and I give you the exact code that you need to copy and paste.

    Finally, onto your second problem:

    The easiest and best way to solve this problem is to edit the corresponding whois page template. Go to the EP-Dev Whois Admin Panel and click "Edit Templates" under Main Menu. Scroll down to the "Whois Report Page" template.

    The default template is:
    Code:
    [[header]]
    [[searchbar]]
    [[whoisreport]]
    [[footer]]
    To add in a margin for the whoisreport code is as simple as:
    Code:
    [[header]]
    [[searchbar]]
    <div style="margin-left: 15px;">[[whoisreport]]</div>
    [[footer]]
    Each whois server returns data in different formats so that is the best you can do.

  3. Join Date
    Nov 2005
    Posts
    3

    problem displaying error page

    ok. I basically understood. I too thought its because of kill or stop function. Just thought you may have a quick answer before I go in for the long way through php manual etc.
    I hope I will get it fixed now.
    One more thing, I don't use include header and footer on my page with include function. I am instead including just the whois.php. It's not a problem just my thought that it will help others if the update is modified so that whois.php can be called in normal page flow. In my case different pages use many other scripts and making a header and footer file would be like making it specially to be included in this script. But the odd I see and have met is when I have to update the header or footer. I am used to update the template file so that all pages are updated from one place. In this case I will have to update this header and footer for this script. I tend to forget to update such files, my bad.
    Just my 2 cents, you are the judge. And thanks for the quick solution

  4. Join Date
    Aug 2004
    Posts
    781

    problem displaying error page

    ok. I basically understood. I too thought its because of kill or stop function. Just thought you may have a quick answer before I go in for the long way through php manual etc.
    I hope I will get it fixed now.
    One more thing, I don't use include header and footer on my page with include function. I am instead including just the whois.php. It's not a problem just my thought that it will help others if the update is modified so that whois.php can be called in normal page flow. In my case different pages use many other scripts and making a header and footer file would be like making it specially to be included in this script. But the odd I see and have met is when I have to update the header or footer. I am used to update the template file so that all pages are updated from one place. In this case I will have to update this header and footer for this script. I tend to forget to update such files, my bad.
    Just my 2 cents, you are the judge. And thanks for the quick solution
    Well, that is why I made noted the understanding of the <? and the ?> significance as well as why the example I gave had BOTH html and PHP content.

    Nearly all websites that I have ever created that are using PHP that do not use a large content management system (whether pre-existing or custom coded or modified) utilize header / footer files. The beauty of including such files means that only one update is needed to make a change to the header, whereas with templates created by, for example, Dreamweaver or Frontpage require re-uploading the entire contents of the site.

    Anyway, the problem will be fixed entirely in future versions so it won't be a problem and such a modification will not be necessary.

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts