#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    84
    Rep Power
    12

    Server problem or code problem???


    Running IIS 5.0 on Server 2000

    The default page served is HOME.PHP which utilizes several include files for various elements of the page. The Site Navigation table, Featured Link table, Google Search table, User Info table, Registration Info table and Link To Geek Emporium tables are all PHP includes.

    The User Info table is the one most recently added (a couple of days ago) and it's been working fine as far as it goes. This morning, that table doesn't process nor does anything that comes after it on the page WHILE IT'S SERVED AS THE DEFAULT DOCUMENT. If you do a direct call to the doc (URL includes document name) it all processes correctly.

    Like I said, this has been working fine for a day or two then all of a sudden it stopped doing so. I've temporarily gotten past it by putting the default doc back to HOME.HTM which uses a redirect to HOME.PHP thus causing it to process correctly. ??? Any ideas anyone ???
    Gordon
    ======
    ECNCweather.com
    Where are we going and why am I in this handbasket?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    84
    Rep Power
    12
    Aw c'mon... Not even a semi-educated WAG? Leave it to me to find a situation completely unique.

    Just in case it might provide a little inspiration, here is the code for userinfo.php
    PHP Code:
    <?php
    if(isset($_SERVER['HTTP_REFERER']))
    {
        
    $url $_SERVER['HTTP_REFERER'];
        
    $title fetchpagetitle($url);
    }
    else
    {
        
    $title 'N/A';
    }

    echo 
    '<table width="98%" border="0" cellspacing="0" cellpadding="2" valign="top" align="center">';
    echo 
    ' <tr>';
    echo 
    '   <th nowrap bgcolor="#666666"><font size="-1" face="Arial, Helvetica, sans-serif" color="#FFFFCC">USER INFO</font></th>';
    echo 
    ' </tr>';
    echo 
    ' <tr><td bgcolor="#333333"><font size="-1" face="Arial, Helvetica, sans-serif" color="#FFFFCC" link="#FFFFCC" vlink="#FFFFCC">';
    echo 
    '   <strong>Referrer:</strong> ',$_SERVER['HTTP_REFERER'];
    echo 
    '</font></td></tr>';
    echo 
    ' <tr><td bgcolor="#333333"><font size="-1" face="Arial, Helvetica, sans-serif" color="#FFFFCC" link="#FFFFCC" vlink="#FFFFCC">';
    echo 
    '   <strong>Page title:</strong> ',$title;
    echo 
    '</font></td></tr>';
    echo 
    ' <tr><td bgcolor="#333333"><font size="-1" face="Arial, Helvetica, sans-serif" color="#FFFFCC" link="#FFFFCC" vlink="#FFFFCC">';
    echo 
    '   <strong>IP Address:</strong> ',$_SERVER['REMOTE_ADDR'];
    echo 
    '</font></td></tr>';
    $hostname gethostbyaddr($_SERVER['REMOTE_ADDR']);
    echo 
    ' <tr><td bgcolor="#333333"><font size="-1" face="Arial, Helvetica, sans-serif" color="#FFFFCC" link="#FFFFCC" vlink="#FFFFCC">';
    echo 
    '   <strong>Host Name:</strong> ',$hostname;
    echo 
    '</font></td></tr>';
    echo 
    ' <tr><td bgcolor="#333333"><font size="-1" face="Arial, Helvetica, sans-serif" color="#FFFFCC" link="#FFFFCC" vlink="#FFFFCC">';
    echo 
    '   <strong>Browser:</strong> ',$_SERVER["HTTP_USER_AGENT"];
    echo 
    '</font></td></tr>';
    echo 
    ' <tr><td bgcolor="#333333"><font size="-1" face="Arial, Helvetica, sans-serif" color="#FFFFCC" link="#FFFFCC" vlink="#FFFFCC">';
    echo 
    '   <strong>Query String:</strong> ',$_SERVER['QUERY_STRING'];
    echo 
    '</font></td></tr>';
    echo 
    ' <tr><td bgcolor="#333333"><font size="-1" face="Arial, Helvetica, sans-serif" color="#FFFFCC" link="#FFFFCC" vlink="#FFFFCC">';
    echo 
    '   <strong>Remote Port:</strong> ',$_SERVER["REMOTE_PORT"];
    echo 
    '</font></td></tr>';
    echo 
    '</font></td></tr>';
    echo 
    '</table>';
    echo 
    '<br />';
    function 
    fetchpagetitle($url
    {
        
    $fp fopen($url'r');
        while(!
    feof($fp)) {
            if(
    preg_match('/<title>([^<]*)</title>/i'fgets($fp1024), $matches)) {
                
    $title $matches[1];
                break;
            }
        }
        
    fclose($fp);
        return 
    $title;
    }
    ?>
    Last edited by flashgc; January 12th, 2004 at 11:04 PM.
    Gordon
    ======
    ECNCweather.com
    Where are we going and why am I in this handbasket?
  4. #3
  5. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,449
    Rep Power
    4539
    I have no idea about PHP on IIS, sorry.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    84
    Rep Power
    12
    Just as a followup... I had the server rebooted and the problem cleared up. We still have no idea as to the particular nature of the problem or why the server should gag on that particular code only when serving the document as default. Way too queer.
    Gordon
    ======
    ECNCweather.com
    Where are we going and why am I in this handbasket?
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2003
    Posts
    84
    Rep Power
    12
    Chapter two of followup.... within 24 hrs of the reboot, the php code started falling down again. I don't know why IIS would serve it correctly sometimes and not others, but I finally pinned it down to a function in the code. Once I removed that function (gets page title of referring page) the code seems to work fine regardless.
    Gordon
    ======
    ECNCweather.com
    Where are we going and why am I in this handbasket?

IMN logo majestic logo threadwatch logo seochat tools logo