Bug #18350 Updated: PHP script executed twice

From: Date: Mon, 15 Jul 2002 15:48:26 +0000
Subject: Bug #18350 Updated: PHP script executed twice
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-14218@lists.php.net to get a copy of this message
ID: 18350 Updated by: hholzgra@php.net Reported By: jobartim@voila.fr -Status: Bogus +Status: Feedback Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.2.1 New Comment: wanna bet? ;) are you really *sure* that your code is correct? have you put an error_log() statement on top of it and verified that the log message appears twice in your error log? with the code fragment you pasted it is not possible to reproduce what you are doing, but the code looks rather suspicious... e.g. where is $tab defined and what is it's content? Previous Comments: ------------------------------------------------------------------------ [2002-07-15 09:31:16] jobartim@voila.fr I really think that it is a bug in the sense that PHP executes the script twice and I don't understand why PHP should have to execute it twice !!! ------------------------------------------------------------------------ [2002-07-15 09:11:23] hholzgra@php.net Sorry, but the bug system is not the appropriate forum for asking support questions. Your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php Thank you for your interest in PHP. ------------------------------------------------------------------------ [2002-07-15 09:07:33] jobartim@voila.fr I just forget to say what is exactly the bug : the script executes twice so it deletes 2 lines when I want only one to be deleted ... ------------------------------------------------------------------------ [2002-07-15 09:01:56] jobartim@voila.fr Here is the script which gives problems, this script delete the lines number $i where $tab[$i] == "on" $fp = fopen($file,"r"); $fp2 = fopen("$file.tmp","w"); $i = 0; while($line = fgets($fp,4096)) { if ($tab[$i] != "on") fwrite($fp2,$line); $i++; } fclose($fp2); fclose($fp); rename("$file.tmp",$file); This script is called by a post form. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18350&edit=1

« previous php.bugs (#14218) next »