PHP pages keep refreshing

Status
Not open for further replies.

cikkolata

Ars Scholae Palatinae
836
Like the subject says, PHP pages keep refreshing.. I've searched, and found other people with the same problem but no solution, I've googled and found other people with the same problem but no solution.

In IE, it constantly refreshes, over and over, in Opera, it just sorta lags badly and doesn't load (or extremely slowly), not sure about any other browsers.

It seems to be some sort of timeout, but I've tried increasing the max_execution_time and restarted Apache (this is on WinXP, with Apache 1.3.22 and PHP 4.1.1 I think)

I think it's the ISAPI thing I'm using, well, in my httpd.conf I have
code:<HR>
Code:
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php

Someone please help?
 

StoneTable

Ars Praefectus
3,274
Subscriptor++
Hrm. Very odd. I telneted to your web server, and did a GET on that page. It returned to me just fine. When I try to pull it up in a browser (IE), though, it seems to flash on the screen for a sec, and go to a "cannot find server".

Looking through the source, I can't say that I see anything in the HTML causing a problem. You sure you don't a bit of php at the bottom of your script tossing things about like that?
 

cikkolata

Ars Scholae Palatinae
836
Originally posted by HitScan:
Double check all of those quotes, you may have inadvertantly "commented" out part of your script, possibly making things run that shouldn't and etc. that, or post the page source so others can have a look-see.
The actual code is in a file I include, and the quotes are in their own file which the PHP code opens

All that's on the page is a check for $show = "full" and show_all_the_damn_quotes(); (Well, to that effect)
(EDIT: Actually, it's only a link to the function..)

Will go double and triple check it now

[This message was edited by cikkolata on March 07, 2002 at 16:25.]
 

cikkolata

Ars Scholae Palatinae
836
Hopefully Infopop won't eat my code...

index.php
code:<HR>
Code:
<?php
/* location of quotes file so if I move it, I don't need to fuck up my code */
$quotes_file = "F:/nikki/site_ext/quotes.txt";

/* include the top bit with the menu etc */
include("site_ext/header.inc");
/* include the file with the PHP functions in (not in this file so I don't go around fucking it up by accident while editing) */
include("site_ext/func_index.php");
?>

Random crap I feel like putting on the front page here




<?
/* show the random quote or full quotes */
quotes($show);

/* if $show is source, pass the filename to source(); */
if ($show == "source") {source($shw_src);}

/* include the bottom part of the page */
include("site_ext/footer.inc");
?>

func_index.php
code:<HR>
Code:
<?

function make_seed()
{
 list($usec, $sec) = explode(' ', microtime());
 return (float) $sec + ((float) $usec * 100000);
}


/* show a random quote or all quotes depending on whether query string show=full */
function quotes($grab_show)
 {
 global $quotes_file; // get quote file path from index page
 $quotes_open = fopen($quotes_file, "r");
 $quotes_read = fread($quotes_open, filesize($quotes_file));
 fclose($quotes_open);

/* show all quotes */
if ($grab_show == "full")
 {
  $quotes_array = split("\n", $quotes_read);
  foreach ($quotes_array as $line)
   {
    $line = str_replace("<", "<", $line);
    $line = str_replace(">", ">", $line);
    print "$line
\n";
   }
  }
 /* while $show doesnt exist */
 elseif (!$grab_show)
  {
  srand(make_seed());
  $quotes_split = split("\n\n", $quotes_read);
  ?>
  fankee [url=http://arhra.ath.cx]arhra[/url] for the random quotes
  thing, even though i hacked it to pieces :P jien inhobbok <IMG WIDTH="15" HEIGHT="15" SRC="/infopop/emoticons/icon_biggrin.gif" alt="big grin">


  <a href="<?=$PHP_SELF?>?show=full">show all quotes</a>
  <? echo sizeof($quotes_split)+1; ?> quotes altogether


  <?
  $quote_rand = $quotes_split[rand(0, sizeof($quotes_split))];
  $quote_rand = str_replace("<", "<", $quote_rand);
  $quote_rand = str_replace(">", ">", $quote_rand);
  $quote_rand = str_replace("\n", "
\n", $quote_rand);
  print "$quote_rand

";
  }
 }

?>

WHY is it putting the smiley code in there? /me fwaps it

[This message was edited by cikkolata on March 07, 2002 at 16:47.]
 
Status
Not open for further replies.