Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [php]IM Gbook v2.0
Forum PHP.pl > Forum > Przedszkole
ArczeX
Witam

Zainstalowałem na swojej stronie Księgę Gości IM Gbook v2.0 wszystko fajnie śmiga ale jest problem ;/

gdy chce dodać wpis w 2 miejscach wywala mi błąd ;/

Warning: ereg() [function.ereg]: Invalid preceding regular expression in /home.14/m/o/t/motodwus/www/guest/guest.php on line 211 (na kodzie nr.19)

Warning: ereg() [function.ereg]: Invalid preceding regular expression in /home.14/m/o/t/motodwus/www/guest/guest.php on line 214 (na kodzie nr.22)






oto kodzik



  1. if ($confy[5]=="tak") {
  2.  
  3. if (file_exists("$guestpath/emots/emotki.ict")) {
  4.  
  5. $emotki_plik=file("$guestpath/emots/emotki.ict");
  6.  
  7. $emot_rozmiar=count($emotki_plik);
  8.  
  9. foreach ($emotki_plik as $emotka) {
  10.  
  11. $emotka=explode("||", $emotka);
  12.  
  13. $dane[0]=str_replace($emotka[0],"<img src=\"$guestpath/emots/$emotka[1]\" border=0>",$dane[0]);
  14.  
  15. }
  16.  
  17. }
  18.  
  19. }
  20.  
  21.  
  22.  
  23. if ($confy[8]=="tak") {
  24.  
  25. if (file_exists("$guestpath/cenzor.ict")) {
  26.  
  27. $cenzor_plik=file("$guestpath/cenzor.ict");
  28.  
  29. reset($cenzor_plik);
  30.  
  31. foreach ($cenzor_plik as $cenzor) {
  32.  
  33. $cenzor=explode("||", $cenzor);
  34.  
  35. $dane[1] = str_replace("$cenzor[0]","$cenzor[1]",$dane[1]);
  36.  
  37. $dane[2] = str_replace("$cenzor[0]","$cenzor[1]",$dane[2]);
  38.  
  39. $dane[3] = str_replace("$cenzor[0]","$cenzor[1]",$dane[3]);
  40.  
  41. $dane[0] = str_replace("$cenzor[0]","$cenzor[1]",$dane[0]);
  42.  
  43. }
  44.  
  45. }
  46.  
  47. }
  48.  
  49.  
  50.  
  51. $template_p=str_replace("{WPIS}",$dane[0],$template_p);
  52.  
  53. $template_p=str_replace("{AUTOR}",$dane[1],$template_p);
  54.  
  55. $template_p=str_replace("{EMAIL}",$dane[2],$template_p);
  56.  
  57. if ($dane[3]!="") {
  58.  
  59. $template_p=str_replace("{WWW}","<a href=\"http://$dane[3]\" target=\"_blank\">www</a>",$template_p);
  60.  
  61. }
  62.  
  63. else {
  64.  
  65. $template_p=str_replace("{WWW}","brak www",$template_p);
  66.  
  67. }
  68.  
  69. if ($dane[4]!="") {
  70.  
  71. $template_p=str_replace("{GG}","<a href=\"gg:$dane[4]\"><img src=\"http://www.gadu-gadu.pl/users/status.asp?id=$dane[4]\" border=\"0\" alt=\"$dane[4]\"></a>",$template_p);
  72.  
  73. }
  74.  
  75. else {
  76.  
  77. $template_p=str_replace("{GG}","<img src=\"$guestpath/template/img/gg.gif\" border=\"0\" alt=\"brak\">",$template_p);
  78.  
  79. }
  80.  
  81. $template_p=str_replace("{DATA}",$dane[5],$template_p);
  82.  
  83. $template_p=str_replace("{CZAS}",$dane[6],$template_p);
  84.  
  85. $template_p=str_replace("{IP}",$dane[7],$template_p);
  86.  
  87. $template_p=str_replace("{HOST}",$dane[8],$template_p);
  88.  
  89. $template_p=stripslashes($template_p);
  90.  
  91. eval("?>".$template_p."<?");
  92.  
  93. }
  94.  
  95. else{
  96.  
  97. echo "<center><b>Brak pliku z szablonem!</b><br>WejdĽ do <a href=&#092;"$guestpath/admin.php\">administracji</a> aby ustawić plik.</center>";
  98.  
  99. }
  100.  
  101. }
  102.  
  103. }
  104.  
  105.  
  106.  
  107. //Jeśli usuniesz poniższy fragment złamiesz prawa autorskie. Uszanuj pracę innych!
    !!
  108.  
  109. echo "<table border=\"0\" width=\"100%\">";
  110.  
  111. echo "<tr>";
  112.  
  113. echo "<td valign=\"top\" align=\"center\" width=\"100%\">Powered by <a href=\"http://www.imps.pl\" target=\"_blank\"><b>IM GBook</b></a></td>";
  114.  
  115. echo "</tr></table>";
  116.  
  117. break;
  118.  
  119.  
  120.  
  121. case "add":
  122.  
  123. if (file_exists("$guestpath/template/gbook.html")) {
  124.  
  125. $template=fopen("$guestpath/template/gbook.html", "r");
  126.  
  127. $template_p=fread($template, filesize("$guestpath/template/gbook.html"));
  128.  
  129. fclose($template);
  130.  
  131. }
  132.  
  133. echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"$templ[0]\" align=\"$templ[7]\">";
  134.  
  135. if (file_exists("$guestpath/ban.ict")) {
  136.  
  137. $ban_plik=file("$guestpath/ban.ict");
  138.  
  139. $ban_size=count($ban_plik);
  140.  
  141. $ban_ip=$_SERVER['REMOTE_ADDR'];
  142.  
  143. $pban="nie";
  144.  
  145. reset($ban_plik);
  146.  
  147. foreach ($ban_plik as $linia) {
  148.  
  149. $linia = explode("||", $linia);
  150.  
  151. if ($linia[0]==$ban_ip) {
  152.  
  153. $pban="tak";
  154.  
  155. }
  156.  
  157. }
  158.  
  159. }
  160.  
  161. if ($pban=="tak") {
  162.  
  163. echo "<tr><td valign=\"top\" align=\"center\">Niestety nie możesz oddać wpisu do księgi gości, ponieważ twoje IP zostało za
    blokowane przez Adminisratora!<br><br></td></tr>"
    ;
  164.  
  165. }
  166.  
  167. else {
  168.  
  169. echo "<tr><td valign=\"top\">";
  170.  
  171. echo "<table width=\"$templ[0]\" height=\"$templ[1]\" bgcolor=\"$templ[2]\" cellspacing=\"0\" cellpadding=\"$templ[3]\" style=\"border: $templ[4] $templ[5] $templ[6];\" align=\"$templ[7]\">";
  172.  
  173. echo "<form method=\"post\" action=\"$confy[0]"."gb=save\" name=\"formularz\">";
  174.  
  175. echo "<tr><td valign=\"top\">*Autor:<br><input type=\"text\" name=\"autor\"></td>";
  176.  
  177. echo "<td rowspan=\"7\" align=\"left\" valign=\"top\">";
  178.  
  179. if ($confy[5]=="tak") {
  180.  
  181. echo "$confy[6]<br><br>";
  182.  
  183. ?>
  184.  
  185. <script language="javascript">
  186.  
  187. function wstawEmot(znaczekEmot) { 
  188.  
  189. formularz.wpis.value+=znaczekEmot; formularz.wpis.focus()
  190.  
  191. }
  192.  
  193. </script>
  194.  
  195. <?
  196.  
  197. if (file_exists("$guestpath/emots/emotki.ict")) {
  198.  
  199. $emotki_plik=file("$guestpath/emots/emotki.ict");
  200.  
  201. reset($emotki_plik);
  202.  
  203. foreach($emotki_plik as $emotka){
  204.  
  205. $emotka=explode("||", $emotka);
  206.  
  207. $emotka_obrazek="$guestpath/emots/$emotka[1]";
  208.  
  209. echo "<img src=\"$emotka_obrazek\" onclick=\"wstawEmot(' $emotka[0] ')\" alt=\"$emotka[0]\" border=\"0\" style=\"cursor: hand;\"> ";
  210.  
  211. }
  212.  
  213. }
  214.  
  215. else { echo "<b>Błąd, brak pliku z emotikonkami!!!</b>"; }
  216.  
  217. }
  218.  
  219. else {
  220.  
  221. echo "<b>Emotikonki zostały wyłączone przez administratora.</b>";
  222.  
  223. }
  224.  
  225. echo "</td></tr>";
  226.  
  227. echo "<tr><td valign=\"top\">*Email:<br><input type=\"text\" name=\"email\"></td></tr>";
  228.  
  229. if(ereg("{WWW}", $template_p)){
  230.  
  231. echo "<tr><td valign=\"top\">WWW:<br><input type=\"text\" name=\"www\"></td></tr>";
  232.  
  233. }
  234.  
  235. if(ereg("{GG}", $template_p)){
  236.  
  237. echo "<tr><td valign=\"top\">GG:<br><input type=\"text\" name=\"gg\"></td></tr>";
  238.  
  239. }


Po wywaleniu lini 212 i 213 (na kodzie 20 i 21) wyskakuje taki błąd

Warning: ereg() [function.ereg]: Invalid preceding regular expression in /home.14/m/o/t/motodwus/www/guest/guest.php on line 419 (na kodzie 229)

Warning: ereg() [function.ereg]: Invalid preceding regular expression in /home.14/m/o/t/motodwus/www/guest/guest.php on line 425 (na kodzie 235)

prosze o pomoc !

jeśli ktoś potrzebował by cały kod to prosze CAŁY KOD
xbigos
spróbój zmienić wyrażenia ereg na eregi:) nie wiem czy cos to pomoże ale warto spróbować
ArczeX
niestety... nic to nie dało pisało to samo tylko zamiast ereg było eregi
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.