php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #22177
Patch File revision 2010-07-09 12:56 UTC by milicicivan3510 at gmail dot com

Patch File for Filesystem function related Bug #22177

Patch version 2010-07-09 12:56 UTC

Return to Bug #22177 | Download this patch
Patch Revisions:

Developer: milicicivan3510@gmail.com

In this php appears this:
Warning: file_exists() expects parameter 1 to be string, resource given in C:\xampp\htdocs\ek\file.php on line 6
What does it mean?
Code:
<?php
$i=1;
$br=2;
$a="name/animal".$i.".php";
while($i<=$br)
{if(file_exists($a))
{$i++;
$br++;
$a="name/animal".$i.".php";
}
else{
$br--;
$a=fopen("name/animal".$i.".php","w") or die ("The file is not created!");
fwrite($a,"<?php\r\n");
fwrite($a,"\$string['day_birth']=\"".$_POST["day"]."\";\r\n");
fwrite($a,"\$string['month_birth']=\"".$_POST["month"]."\";\r\n");
fwrite($a,"\$string['year_birth']=\"".$_POST["year"]."\";\r\n");
fwrite($a,"\$string['name_mother']=\"".$_POST["mother_name"]."\";\r\n");
fwrite($a,"?>");
fclose($a);
}}
?>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 03:01:35 2024 UTC