Forum Moderators: coopster
For example:
in a page index.shtml I have an SSI:
<!--#include virtual="/includes/rightmenu.html"-->
The file rightmenu.html in turn has some HTML code but also:
<!--#include virtual="/includes/randomquote.phtml"-->
The file randomquote.phtml is where the trouble lies. It is supposed to open a data file of quotes, and then display one at random. The file looks like:
<?php
$fp = fopen ("../random/quotes.db", "r");
if (!$fp) {
echo "file cant be opened";
exit();
}
$n = 0;
while (!feof ($fp)) {
$buffer = fgets ($fp, 4096);
++$n;
}
--$n;
srand ((double) microtime() * 1000000);
$randno = rand(1, $n);
rewind ($fp);
$n = 0;
while ($n < $randno) {
$buffer = fgets ($fp, 4096);
++$n;
}
$buffer = trim($buffer);
fclose ($fp);
$quote_array = preg_split ("[\¦]", $buffer);
$ID = $quote_array[0];
$Name = $quote_array[1];
$Company = $quote_array[2];
$URL = $quote_array[3];
$Quote = $quote_array[4];
$Quote_Word_Array = explode(' ',$Quote);
$maxwords = 25;
$Quote_Size = count ($Quote_Word_Array);
if ($Quote_Size > $maxwords) {
foreach ($Quote_Word_Array as $word) {
$wordcount++;
if ($wordcount <= $maxwords) {
$Quote_limit = $Quote_limit . " " . $word;
}
}
$Quote_limit = $Quote_limit . "...." . " <A HREF=\"/aboutias/client_quotes.html#$ID\" CLASS=\"Quotes\">(cont.)</A>";
}
else { $Quote_limit = $Quote; }
When I load the page index.shtml, it hangs at the spot where quotes should appear.
What happened between v4.3.2 and 4.4.1 that could cause this?
exit('You got this far'); message into the process step. Keep moving that statement further into the steps until you get no further. Then at least you can narrow down the problem area to an exact function or line number. Also, crank up your error_reporting() [php.net] during troubleshooting here so you can see any and all messages.