Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts

    ?? Puzzled... Page sometimes not loading...

    I have a suspicion that it is a server problem... But can you guys detect a problem with this code that would cause it to randomly sometimes not load?

    PHP Code:
    <?php
    include("this_file.php");
    $page_id intval($_GET['pid']);
    if (!
    $page_id){
        
    $page_id 1;
        }
    $page_details mysql_fetch_assoc(mysql_query("SELECT * FROM `site_pages` WHERE `page_id`='$page_id'"));
    $page_name "www.x.co.za/index.php?pid=" $page_id;
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
        <title><?php echo($page_details['page_title']); ?></title>
        <link rel="stylesheet" href="default.css" type="text/css"/>
        <link rel="stylesheet" href="drop-down.css" type="text/css"/>
    </head>

    <body>
    <table width="800" align="center" cellspacing="0" cellpadding="0" style="background-color:white;">
    <!--include in header-->
    <?php include("includes/header.php"); ?>
    <!--end of header-->
    <tr><td colspan="2" class="c_blue" height="5"></td></tr>
    <tr><td colspan="2" height="30" id="gray_bar">
    <?php include("includes/subpagelinks.php"); ?>
    </td></tr>
    <tr><td colspan="2">
    <table width="800" align="center" cellspacing="0" cellpadding="0"><tr>
    <td width="160" class="c_grey" height="420" valign="top">
    <!--Include in links-->
    <?php include("includes/links.php"); ?>
    </td>
    <td width="5" class="c_orange"></td>
    <td width="635" id="right_content" valign="top">
    <div id="page_header_bar"><?php echo($page_details['page_title']); ?></div>
    <div id="content_container">
    <?php echo($page_details['page_content']); ?>
    </div>
    <div style="text-align:right; padding-right:5px; padding-bottom:5px;"><a style="font-size:14px;" href="mailto:blank?Subject=Interesting Website:www.x.co.za&Body=Hi I found this really interesting website <?php echo($page_name); ?>" >Tell a friend</a></div>
    </td></tr>
    <tr>
    <td width="160" class="c_grey"></td>
    <td width="5" class="c_orange"></td>
    <td class="c_blue" style="text-align:center; color:white;">Contacts: John W Frith CA(SA), PO Box 2440, Port Alfred, 6170<br>
    Tel: 046 624 9000, Fax: 086 668 3374, Cell: 083 378 3374, email: <a style="text-decoration:none; color:white; font-weight:bold;" href="mailto:john@yfcwill.co.za">john@yfcwill.co.za</a></td>
    </table>
    </td></tr>
    </table>


    </body>
    </html>
    I didnt write the code... and I know its a bit sloppy. but still what is giving this error....

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,492
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    I'm guessing you're getting a PHP error that is stopping the script.

    In this part:
    PHP Code:
    <?php
    include("this_file.php");
    $page_id intval($_GET['pid']);
    if (!
    $page_id){
        
    $page_id 1;
        }
    $page_details mysql_fetch_assoc(mysql_query("SELECT * FROM `site_pages` WHERE `page_id`='$page_id'"));
    $page_name "www.x.co.za/index.php?pid=" $page_id;
    ?>
    Use the server PHP error log, and log PHP errors to see what's happening.

    Maybe try something like this (thinking that $page_id is null, but it exists) ...
    And what if $page_id=0 or $page_id=9999999?
    Are there limits to what it can be?

    PHP Code:
    <?php
    include("this_file.php");
    $page_id intval($_GET['pid']);
    if (
    strlen($page_id)<1){
        
    $page_id 1;
        }
    $page_details mysql_fetch_assoc(mysql_query("SELECT * FROM `site_pages` WHERE `page_id`='$page_id'"));
    $page_name "www.x.co.za/index.php?pid=" $page_id;
    ?>

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Location
    Grahamstown, South Africa
    Posts
    237
    Thanks
    6
    Thanked 17 Times in 17 Posts
    Well even if $page_id is null it would just generate a notice. Of course I told him to use error_reporting(6143); but he obviously removed it at some stage.

    Anyway the problem is, the page doesn't generate an error, just sometimes it doesnt load AT ALL, its really weird... just says the page cannot be found...

    You can sit at two computers and open the website, it opens on one and not on the other. Then both, then none. But it just seems really random.

  • #4
    New to the CF scene
    Join Date
    Jan 2008
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That is most likely a server or internet problem, if no PHP error is output.


  •  

    Posting Permissions

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