The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> System Administration
> IIS
|
Server problem or code problem???
Discuss Server problem or code problem??? in the IIS forum on Dev Shed. Server problem or code problem??? IIS forum discussing Microsoft's Internet Information Server including its configuration, optimization and other related topics. IIS is the most popular web server for the Windows platform.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

January 11th, 2004, 11:25 AM
|
|
Contributing User
|
|
Join Date: Nov 2003
Posts: 84
Time spent in forums: 8 h 39 m 36 sec
Reputation Power: 10
|
|
|
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?
|

January 12th, 2004, 09:59 PM
|
|
Contributing User
|
|
Join Date: Nov 2003
Posts: 84
Time spent in forums: 8 h 39 m 36 sec
Reputation Power: 10
|
|
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($fp, 1024), $matches)) {
$title = $matches[1];
break;
}
}
fclose($fp);
return $title;
}
?>
Last edited by flashgc : January 12th, 2004 at 10:04 PM.
|

January 13th, 2004, 12:20 AM
|
|
|
|
I have no idea about PHP on IIS, sorry.
|

January 15th, 2004, 11:58 AM
|
|
Contributing User
|
|
Join Date: Nov 2003
Posts: 84
Time spent in forums: 8 h 39 m 36 sec
Reputation Power: 10
|
|
|
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.
|

January 17th, 2004, 07:48 PM
|
|
Contributing User
|
|
Join Date: Nov 2003
Posts: 84
Time spent in forums: 8 h 39 m 36 sec
Reputation Power: 10
|
|
|
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.
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|