PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
dear friends,
i have the code
<?php
$test=mkdir("$category", 0755);
chmod("$category", 0755);
$file = '../main/cate/poll1.php';
$newfile = "$foldername/$category/index.php";
if (!copy($file, $newfile)) {
echo "failed to copy $file...\n";
}
chmod("$category/index.php", 0755);
$handle = fopen("$category/index.php", "r+");
$content=file_get_contents($newfile);
//add id to the index file of the folder
$new="<? $";
$new.="id=$pid ; ";
$content="$new".$content;
if (fwrite($handle, $content) === FALSE) {
echo "Cannot write to file ( ".$filename.")";
exit;
}//fwrite
// }//if not exist
}//while
?>
the erro message is
Warning: copy(ColoradoStateRamsatAirFor/230267/index.php) [function.copy]: failed to open stream: No such file or directory in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 42
failed to copy ../main/cate/poll1.php...
Warning: chmod() [function.chmod]: No such file or directory in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 45
Warning: fopen(230267/index.php) [function.fopen]: failed to open stream: No such file or directory in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 46
Warning: file_get_contents(ColoradoStateRamsatAirFor/230267/index.php) [function.file-get-contents]: failed to open stream: No such file or directory in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 47
Warning: fwrite(): supplied argument is not a valid stream resource in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 53
Cannot write to file ( )
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Last edited by B.Murali Krishna on Fri May 12, 2006 3:42 am, edited 1 time in total.
$test=mkdir("$category", 0755);
chmod("$category", 0755);
$file = '../main/cate/poll1.php';
$newfile = "$foldername/$category/index.php";
if (!copy($file, $newfile)) {
echo "failed to copy $file...\n";
}
chmod("$category/index.php", 0755);
$handle = fopen("$category/index.php", "r+");
$content=file_get_contents($newfile);
//add id to the index file of the folder
$new="<? $";
$new.="id=$pid ; ";
$content="$new".$content;
if (fwrite($handle, $content) === FALSE) {
echo "Cannot write to file ( ".$filename.")";
exit;
}//fwrite
// }//if not exist
}//while
the erro message is
Warning: copy(ColoradoStateRamsatAirFor/230267/index.php) [function.copy]: failed to open stream: No such file or directory in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 42
failed to copy ../main/cate/poll1.php...
Warning: chmod() [function.chmod]: No such file or directory in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 45
Warning: fopen(230267/index.php) [function.fopen]: failed to open stream: No such file or directory in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 46
Warning: file_get_contents(ColoradoStateRamsatAirFor/230267/index.php) [function.file-get-contents]: failed to open stream: No such file or directory in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 47
Warning: fwrite(): supplied argument is not a valid stream resource in c:\wamp\www\showtickets\coloradostateramsatairfor\index.php on line 53
Cannot write to file ( )
does'nt look like you validate each function. is mkdir actually creating the dir!. use php tags. it is pretty hard to read. user error_reporting(E_ALL)