Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> PsNews - problem., błąd w kodzie?
eMichu
post
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 13.12.2007

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


Witam!

Mam problem ze skryptem newsów "PsNews". Otóż instalowałem go na serwerach boo.pl i innych i nie było problemu. Tym razem chce postawić stronę na darmowym serwerze. Wszystko ok, ale mam problem z błędami w kodzie. Może mi ktoś powiedzieć, czy to rzeczywiście błąd w kodzie, czy wina serwera? Serwery, których używam 000webhost.com i lua.pl
Kod

   <b>Warning</b>:  fopen(news.txt) [<a href="http://nistelrooy.000webhost.com/news/function.fopen">function.fopen</a>]: failed to open stream: Permission denied in <b>/home/a3296681/public_html/news/admin.php</b> on line <b>99</b>
    
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><div align="center"><a href="http://www.000webhost.com/"><font color="#000000" face="Arial" size="1">Free Web Hosting</font></a></div></td></tr></tbody>  </table>  
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><font color="#000000" face="Arial" size="1"><b>PHP Error Message</b></font></td></tr></tbody>  </table>  
     <b>Warning</b>:  flock() expects parameter 1 to be resource, boolean given in <b>/home/a3296681/public_html/news/admin.php</b> on line <b>100</b>
    
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><div align="center"><a href="http://www.000webhost.com/"><font color="#000000" face="Arial" size="1">Free Web Hosting</font></a></div></td></tr></tbody>  </table>  
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><font color="#000000" face="Arial" size="1"><b>PHP Error Message</b></font></td></tr></tbody>  </table>  
     <b>Warning</b>:  fputs(): supplied argument is not a valid stream resource in <b>/home/a3296681/public_html/news/admin.php</b> on line <b>101</b>
    
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><div align="center"><a href="http://www.000webhost.com/"><font color="#000000" face="Arial" size="1">Free Web Hosting</font></a></div></td></tr></tbody>  </table>  
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><font color="#000000" face="Arial" size="1"><b>PHP Error Message</b></font></td></tr></tbody>  </table>  
     <b>Warning</b>:  flock() expects parameter 1 to be resource, boolean given in <b>/home/a3296681/public_html/news/admin.php</b> on line <b>102</b>
    
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><div align="center"><a href="http://www.000webhost.com/"><font color="#000000" face="Arial" size="1">Free Web Hosting</font></a></div></td></tr></tbody>  </table>  
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><font color="#000000" face="Arial" size="1"><b>PHP Error Message</b></font></td></tr></tbody>  </table>  
     <b>Warning</b>:  fclose(): supplied argument is not a valid stream resource in <b>/home/a3296681/public_html/news/admin.php</b> on line <b>103</b>
    
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><div align="center"><a href="http://www.000webhost.com/"><font color="#000000" face="Arial" size="1">Free Web Hosting</font></a></div></td></tr></tbody>  </table>  
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><font color="#000000" face="Arial" size="1"><b>PHP Error Message</b></font></td></tr></tbody>  </table>  
     <b>Warning</b>:  fopen(komentarze/2) [<a href="http://nistelrooy.000webhost.com/news/function.fopen">function.fopen</a>]: failed to open stream: Permission denied in <b>/home/a3296681/public_html/news/admin.php</b> on line <b>105</b>
    
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td><div align="center"><a href="http://www.000webhost.com/"><font color="#000000" face="Arial" size="1">Free Web Hosting</font></a></div></td></tr></tbody>  </table>  
   <table align="center" bgcolor="#ffffdf" border="1" bordercolor="#e8b900" cellpadding="2">  <tbody><tr><td>
   </td></tr></tbody>  </table>  
     <b>Warning</b>:  fclose(): supplied argument is not a valid stream resource in <b>/home/a3296681/public_html/news/admin.php</b> on line <b>107</b>


Błąd pojawia się przy próbie dodania newsa.

Kod lini newsa:
100 - 107
Kod
     flock($file, 2);
                 fputs($file, $puts);
                 flock($file, 3);
                 fclose($file);

                 $file = fopen("komentarze/$liczba", "w");
                 fputs($file, "");
                 fclose($file);
Go to the top of the page
+Quote Post

Posty w temacie
- eMichu   PsNews - problem.   5.03.2008, 20:02:15
- - Xniver   CHMOD 777 na pliku news.txt   5.03.2008, 20:05:37
- - eMichu   Ok , pomogło, ale zostały jeszcze dwa b...   5.03.2008, 20:25:11
- - l0ud   Musisz nadać chmod 777 na katalog komentarze oraz ...   5.03.2008, 21:40:58


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

 



RSS Aktualny czas: 23.08.2025 - 15:10