Ich selber kriege bei meinem Hoster bei chmod() ne Fehlermeldung, da die Funktion deaktiviert ist. Ansonsten steht im Manual:
Gibt bei Erfolg TRUE zurück, im Fehlerfall FALSE.
$check_engine_topic_file = "blabla.dat"
if (file_exists($check_engine_topic_file))
{
chmod ($check_engine_topic_file, 0777);
$engine_topic_file = fopen($check_engine_topic_file,"a");
fputs ($engine_topic_file, $engine_topic_content);
fclose($engine_topic_file);
}
else
{
$engine_topic_file = fopen($check_engine_topic_file,"a");
if (!$engine_topic_file ) $engine_topic_file = fopen($check_engine_topic_file,"a");
chmod ($check_engine_topic_file, 0777);
fputs ($engine_topic_file, $engine_topic_new_content_file);
fclose($engine_topic_file);
$enginefile_read = fopen("file2.dat","a");
$content_index = "<li><a href=$labor-$topic_id.html>$topic_data[title]</a></li>";
fwrite($enginefile_read, $content_index );
fclose($enginefile_read);
}
$check_engine_topic_file = "blabla.dat";
if (file_exists($check_engine_topic_file))
{
$engine_topic_file = fopen($check_engine_topic_file,"a");
fwrite ($engine_topic_file, $engine_topic_content);
fclose($engine_topic_file);
}
else {
$engine_topic_file = fopen("$check_engine_topic_file","w");
fwrite ($engine_topic_file, "$engine_topic_new_content_file");
fclose($engine_topic_file);
$enginefile_read = fopen("file2.dat","a");
$content_index = "<li><a href=$labor-$topic_id.html>$topic_data[title]</a></li>";
fwrite($enginefile_read, "$content_index", "a" );
fclose($enginefile_read);
chmod ($check_engine_topic_file, 0777);
}
$check_engine_topic_file = "blabla.dat";
if (file_exists($check_engine_topic_file))
{
$engine_topic_file = fopen($check_engine_topic_file,"a");
fwrite ($engine_topic_file, $engine_topic_content);
fclose($engine_topic_file);
}
else {
$engine_topic_file = fopen($check_engine_topic_file,"w");
fwrite ($engine_topic_file, $engine_topic_new_content_file);
fclose($engine_topic_file);
$enginefile_read = fopen("file2.dat","a");
$content_index = "<li><a href=$labor-$topic_id.html>$topic_data[title]</a></li>";
fwrite($enginefile_read, $content_index );
fclose($enginefile_read);
chmod ($check_engine_topic_file, 0777);
}
Kommentar