Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> System komentarzy nie działa
mako241
post
Post #1





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 17.07.2005

Ostrzeżenie: (0%)
-----


Napisalem bardzo prosty system komentarzy, oto jego kod:

Kod
<?
if ($message)
    {
    $message = ereg_replace("\r\n\r\n", "\n<P>", $message);
    $date = date("l, F j Y, h:i a");
    $message = "<B>$name </B> -- $date<P> $message <BR><HR>";
    $fp = fopen (basename($PHP_SELF) . ".comment", "a");
    fwrite ($fp, $message);
    fclose ($fp);
    }
@readfile(basename(($PHP_SELF . ".comment")));
?>
<FORM method="post">
<b>Nick:</b><BR><INPUT name="name" type="text" size="55"><BR>
<b>Tresc komentarza:</b><BR><TEXTAREA name="message" rows=10 cols=55 wrap=virtual>
</TEXTAREA><BR>
<INPUT name="submit" type="submit" value="Dodaj komentarz">
</FORM>

</body>
</html>


Gdy dałem go na serwer (obslugujący php) wszystko wyswietlilo sie jak nalezy, wpisalem swoj nick i tresc komenatrza, ale gdy sprobowalem dodac komentarz zamiast komentarza dostalem komunikat:

Kod
Warning: fopen(index.php.comment) [function.fopen]: failed to open stream: Permission denied in /mnt/home/madex/public_html/mako/cos/index.php on line 7

Warning: fwrite(): supplied argument is not a valid stream resource in /mnt/home/madex/public_html/mako/cos/index.php on line 8

Warning: fclose(): supplied argument is not a valid stream resource in /mnt/home/madex/public_html/mako/cos/index.php on line 9


Co mam zrobić?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 20.08.2025 - 05:15