Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Problem z modułem
partoles
post
Post #1





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 8.10.2010

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


Witam,
Napisałem moduł i pojawia się następujący błąd:
  1. Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/pit36/domains/sm.ayz.pl/public_html/londyn/myslodsiewnia.php on line 67

  1. function mysli(){
  2.  
  3.  
  4. $z="SELECT * FROM `hcws` WHERE `co`='dane' ORDER BY data DESC";
  5. $w=mysql_query($z);
  6. echo'<ol>';
  7. [b]67 linia -[/b] while($r=mysql_fetch_array($w))
  8. {
  9. <b>I</b>mie: <i>".$r['imie']." </i> <br>
  10. <b>T</b>resc: <br>".$r['tresc']."
  11.  
  12. ");
  13. }
  14. echo'</ol>';
  15. }

Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
partoles
post
Post #2





Grupa: Zarejestrowani
Postów: 14
Pomógł: 0
Dołączył: 8.10.2010

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


A więc, poszukałem w internecie shoutboxa i znalazłem, ale problem polega na tym że nie wiem jak dodać pytanie chroniące przed botem, jak dodam je w innym module to wywala błędy.
Kod Shoutboxa:
  1. <?
  2. /*****************************************************/
  3. /* jPORTAL - internetowy system portalowy */
  4. /*****************************************************/
  5. /* autor: Pawel 'jaco' Jaczewski */
  6. /* email: */
  7. /*****************************************************/
  8. include ('config.php');
  9.  
  10. #===========================#
  11.  
  12. function site_main() {
  13.  
  14. global $tresc, $imie, $all, $ip, $REMOTE_ADDR, $emots, $prefix, $PHP_SELF;
  15.  
  16. if(is_user_login()=='yes')
  17. $info = get_user_info();
  18.  
  19. main_title_open();
  20. echo 'Shoutbox';
  21. main_title_close();
  22. main_text_open();
  23. #=================#
  24. $shoutbox = $prefix.'shoutbox';
  25. $tresc = wordwrap($tresc, 15, " ", 1);
  26. $imie = wordwrap($imie, 15, " ", 1);
  27. $tresc = strip_tags ($tresc);
  28. $imie = strip_tags ($imie);
  29. #=================#
  30. if ($tresc!="" && $imie!="") {
  31. $zapytanie = "INSERT INTO $shoutbox SET tresc='$tresc', imie='$imie', ip='$ip'";
  32. $wykonaj = mysql_query ($zapytanie);
  33. $dalej="shoutbox.php";
  34. header("Location: $dalej");
  35. }
  36. if ($all!=ok) {
  37. $zapytanie = "SELECT * FROM $shoutbox ORDER BY id DESC LIMIT 10";
  38. $wykonaj = mysql_query($zapytanie);
  39. while ($wiersz = mysql_fetch_array($wykonaj)) {
  40. $wiersz['tresc'] = smilies($wiersz['tresc']);
  41. $wiersz['imie'] = smilies($wiersz['imie']);
  42. echo ("Napisał: <b>".$wiersz['imie']."</b><br>".$wiersz['tresc']."<br>");echo '<hr size="1" noshade>';
  43. }
  44. echo ("<center>[<a href=?all=ok> Zobacz wszystkie wpisy </a>]</center><br>");
  45.  
  46. }
  47.  
  48. <script language="JavaScript">
  49. function emoticon(tresc) {
  50. tresc = \'\' + tresc + \'\';
  51. if (document.shoutbox.tresc.createTextRange && document.shoutbox.tresc.caretPos) {
  52. var caretPos = document.shoutbox.tresc.caretPos;
  53. caretPos.tresc = caretPos.tresc.charAt(caretPos.tresc.length - 1) == \' \' ? tresc + \' \' : tresc;
  54. document.shoutbox.tresc.focus();
  55. } else {
  56. document.shoutbox.tresc.value += tresc;
  57. document.shoutbox.tresc.focus();
  58. }
  59. }
  60. </script>
  61. <table width="95%" align="center">
  62. <tr>
  63. <td class="uni_01" valign="top">
  64.  
  65.  
  66. <td width="70%"><form name="shoutbox" method="post" action="shoutbox.php">
  67. <table width="100%" border="0" cellspacing="1" cellpadding="1" align="center">
  68. <tr>
  69. <td width="30%" class="uni_01" align="right" valign="top"><b>imię</b></td>
  70. <td width="70%" class="uni_01">';
  71.  
  72. if(is_user_login()=='yes') echo '<b>'.$info[1].'<input type="hidden" name="imie" value="'.$info[1].'">';
  73. else
  74. echo '<input type="text" name="imie" value="'.$imie.'" size="35">';
  75.  
  76. echo '</td>
  77. </tr>
  78. <tr>
  79. <td width="30%" class="uni_01" align="right" valign="top"><b>treść</b></td>
  80. <td width="70%" class="uni_01">
  81. <textarea name="tresc" cols="50" rows="10"></textarea>
  82. </td>
  83. </tr>
  84. <tr>
  85. <td width="30%" class="uni_01" align="right">&nbsp;</td>
  86. <td width="70%" class="uni_01">
  87. <input type="hidden" name="ip" value="'.$REMOTE_ADDR.'">
  88. <input style="font-weight: bold;" type="submit" name="ok" value="dodaj">
  89. <input type="reset" name="Reset" value="wyczyść">
  90. </td>
  91. </tr>
  92. </table>
  93. </form></td>
  94. </tr>
  95. </table>';
  96.  
  97. if ($all=='ok') {
  98. $zapytanie = "SELECT * FROM $shoutbox ORDER BY id DESC";
  99. $wykonaj = mysql_query($zapytanie);;
  100. while ($wiersz = mysql_fetch_array($wykonaj)) {
  101. $wiersz['tresc'] = smilies($wiersz['tresc']);
  102. $wiersz['imie'] = smilies($wiersz['imie']);
  103. echo ("<br>Napisał: <b>".$wiersz['imie']."</b><br>".$wiersz['tresc']."<br>");echo '<hr size="1" noshade>';
  104. }
  105. echo ("<center>[<a href=\"java script:history.back(1)\">Powrót</a>]</center><br>");
  106. }
  107. main_text_close();
  108. }
  109.  
  110.  
  111. #=====================================================#
  112.  
  113. $site_title = 'Myslodsiewnia';
  114. $meta_info = '';
  115.  
  116. include("theme/$theme/normal.php");
  117.  
  118.  
  119. ?>
Go to the top of the page
+Quote Post

Posty w temacie


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: 26.09.2025 - 00:53