|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[1998-02-20 22:16 UTC] rasmus
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 12:00:01 2025 UTC |
The following snippet always generates Parse error: parse error in /home/virtual/muwupa/update.php3 on line 83 >> CODE SNIPPET << 78 $pwdfile = @file($htpasswd); 79 $fp = fopen($htpasswd, "w"); 80 81 for ($i = 0; $i < count($pwdfile); $i++) { 82 echo "delete: ", $delete, "; pwdfile: ", $pwdfile[$i]; 83 if (!(ereg($delete, $pwdfile[$i], $t)) { 84 $temp = $pwdfile[$i]; 85 fputs($fp, $temp); 86 } 87 } 88 89 fclose($fp); >> END SNIPPET << The numbers in front of each line of code are the corresponding line numbers. Seems like a bug in ereg. The syntax according to PHP/FI 2 and PHP3 says that it should be fine. Also the following code seemed to have a bug in $deluser. When echoing out deluser, as below, it said that the value of deluser was "Array" rather than the real value of "test2" >> CODE SNIPPET << 78 $pwdfile = @file($htpasswd); 80 $fp = fopen($htpasswd, "w"); 81 82 for ($i = 0; $i < count($pwdfile); $i++) { 83 $deluser = explode(":", $pwdfile[$i]); 84 echo "deluser: ", $deluser, "; delete: ", $delete, "; pwdfile: ", $pwdfile[$i]; 85 if ($deluser[0] != $delete) { 86 $temp = $pwdfile[$i]; 87 fputs($fp, $temp); 88 } 89 } 90 91 fclose($fp); >> END SNIPPET << I'd be happy to email the three files that comprise the entire PHP application if anyone is interested.