ID: 14222
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Apache related
Operating System: Windows XP Pro
PHP Version: 4.0.6
New Comment:
OK, its like i expected.
When you fill out a loop (any kind of one) with enough data it happens (a overflow??)
<?
//create an array with 100 items with different informations
for($i=0;$i<100;$i++){
srand((double)microtime()*1000000);
$testarray[] = md5(uniqid(rand()));
}
?>
<table>
<?
//output from this array, 3 times for enougth data
for($i=0;$i<100;$i++){
?> <tr>
<td>
<font face="Tahoma, Tahoma, Tahoma" size="1"
color="black" style="text-decoration:none">
<a href="#"
target="top"><?=$testarray[$i]?></a></font>
</td>
<td>
<font face="Tahoma, Tahoma, Tahoma" size="1"
color="black" style="text-decoration:none">
<a href="#"
target="top"><?=$testarray[$i]?></a></font>
</td>
<td>
<font face="Tahoma, Tahoma, Tahoma" size="1"
color="black" style="text-decoration:none">
<a href="#"
target="top"><?=$testarray[$i]?></a></font>
</td>
</tr>
<? };?>
</table>
Previous Comments:
------------------------------------------------------------------------
[2001-11-26 07:14:15] [EMAIL PROTECTED]
Its not reproduce able (thats why called weird)
specially the output is always diffrent and irregular...
i'll test it in the office (also with XP)
------------------------------------------------------------------------
[2001-11-26 07:09:14] [EMAIL PROTECTED]
Please include a SHORT example script that can be used to
reproduce this. And also try PHP 4.1.0 (will be released today/tomorrow)
--Jani
------------------------------------------------------------------------
[2001-11-26 02:48:37] [EMAIL PROTECTED]
Ah here is an output examle (describet ping ~20).
http://tugs.imp.ch/index.html.2
my localhostoutput:
http://tugs.imp.ch/index.html.3
i cant pate the output of the 3rd test (ping ~60) because its impossible to get the
page.
btw browser issius with this:
ie starts to relaod and relaod the page again and again, sometimes often, sometimes
not. he relaods until he gets a useable document or used so many http connections that
he cant find the document :)
opera just dont stop loading the page or crashes totally :)
------------------------------------------------------------------------
[2001-11-26 02:37:45] [EMAIL PROTECTED]
Its like the Bug id #13371, just i found the same thing with Apache 1.3.22.
Installed:
Apache 1.3.22
PHP 4.0.6 (both, full and installer make problems)
MySQL 4.0.0a
on a Win XP En Machine.
PHP used with php4apache.dll
Very weird things:
Some code dont work, some work fine.
Ex.: phpMyAdmin dont have any problems
Code Example:
//////////////////////////////////////
//Start of Code Example
//////////////////////////////////////
<html>
<head>
<?php
//Funktion für DB Errors
function print_db_error($query) {
$errno=addslashes(mysql_errno());
$error=addslashes(mysql_error());
echo $query."<br>liefert folgende Fehlermeldung:<br>".$errno.$error;
}
//Login
function login($uin){
if($uin == "xxx") return 1;
};
//simple abfrage (1 user)
if($HTTP_POST_VARS[submit]==go){
if($username==xxx AND $password==xxx)
$uin = "xxx";
};
//$loggedin = login($uin);
$loggedin = 1;
//Funktion für MySQL querys
function sql($query){
$hostname = "dedi.gamelife.ch";
$db_username = "xxx";
$password = "xxx";
$dbName1 = 'xxx';
$conn = mysql_pconnect($hostname, $db_username, $password);
if(!$conn){
echo "<B>Oops, der Datenbankserver hat wohl die Hosen
runtergelassen!";
exit;
};
$select = mysql_select_db($dbName1,$conn);
$abfrage=mysql_query($query, $conn)
or
print_db_error($query);
return $abfrage;
};
//Tables
$tbl_list = priv_divxlist;
//Update the instore
if($action=="changestore"){
(mysql_result(sql("SELECT instore FROM $tbl_list WHERE id='$id'"),0)) ?
$newstore = "0" : $newstore = "1";
sql("UPDATE $tbl_list SET instore='$newstore' WHERE id='$id'");
};
//Default: sortby name
if(!isset($sortby))
$sortby = "titel asc";
?>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#829DD2" vlink="#829DD2">
<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<? if(!$loggedin){?>
<form action="<?=$PHP_SELF?>?sortby=<?=$sortby?>" method=post>
Login: <input type="text" name="username" size="5"> <input
type="password" name="password" size="5"> <input type="submit" name="submit"
value="go"></form>
<? }else{ ?>
<a href="newp.htm">Create new Item</a><br>
<? }; ?>
<br>
<table border=0 cellpadding="0" cellspacing="0">
<tr>
<td><font size=2><a href="<?=$PHP_SELF?>?sortby=<?
echo ($sortby=="titel desc") ? "titel asc" : "titel desc";
?>&uin=<?=$uin?>">Titel</a></font><br><br></td>
<td><font size=2><a href="<?=$PHP_SELF?>?sortby=<?
echo ($sortby=="lang desc") ? "lang asc" : "lang desc";
?>&uin=<?=$uin?>">Sprache</a> </font><br><br></td>
<td><font size=2><a href="<?=$PHP_SELF?>?sortby=<?
echo ($sortby=="anz desc") ? "anz asc" : "anz desc";
?>&uin=<?=$uin?>">Anz</a> </font><br><br></td>
<? if($loggedin){ ?>
<td><font size=2>Delete </font><br><br></td>
<td><font size=2>Edit</font><br><br></td>
<td><font size=2>In Store</font><br><br></td>
<? }; ?>
</tr>
<?
$abfrage = sql("select id,titel,anz,lang,instore from $tbl_list ORDER by
$sortby,titel");
while (list($id,$theaser,$anz,$lang,$instore) = mysql_fetch_row($abfrage)){
$theaserprint = $theaser;
//if (strlen($theaser) > 30) $theaserprint =
substr($theaserprint,0,25)."..."; ?>
<tr>
<td width="300"><font
size=2><?=$theaserprint?></font></td>
<td width="50" align="center"><font
size=2><?=$lang?></font></td>
<td width="30" align="center"><font
size=2><?=$anz?></font></td>
<? if($loggedin){?>
//////////////////////////////////////
//Note part here to
<td width="30" align="center"><font size=2><a
href="del.php?id=<?=$id?>&uin=<?=$uin?>" style="text-decoration:
none;">[del]</a></font></td>
<td width="39" align="center"><font size=2><a
href="editp.php?id=<?=$id?>&uin=<?=$uin?>" style="text-decoration:
none;">[edit]</a></font></td>
//here
//////////////////////////////////////
<td width="39" align="center"><font size=2><a
href="<?=$PHP_SELF?>?uin=<?=$uin?>&sortby=<?=$sortby?>&action=changestore&id=<?=$id?>"
style="text-decoration: none;"><? echo ($instore) ? "yes" : "no";?></a></font></td>
<? };?>
</tr>
<?};?>
</table>
Total Films: <?=mysql_result(mysql_query("SELECT count(*) FROM $tbl_list"),0);?>
</font>
</body>
</html>
//////////////////////////////////////
// End of code example
//////////////////////////////////////
Take a look at the special marked part in the code. If this part isnt included, the i
still have errors, but only about 20% than with the code (lol).
The code should be 100% correct also, and on *nix servers it runs very well.
Theremore the output is always different. It outputs what it wants :) with part like
"dddfffff" and 200x a "F", this also in a loop where thats nearly impossible :)
Also i tested it with some friends. At the time it runned well on my localhost (with a
smaller code), i wget the document from an other server (ping ~20) and had some more
errors in it, but constant more (tried it more than once).
An other person tried it also (ping ~60) and never reached the dokument how it should
be.
Hope i can help out with this :p
Greets
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14222&edit=1
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]