Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wstawianie symbolu
Gibcio2008
post 26.10.2008, 11:58:53
Post #1





Grupa: Zarejestrowani
Postów: 54
Pomógł: 0
Dołączył: 26.10.2008

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


Kod
$file = file('includes/js/gibo_editor/emoty/emoty.txt');<BR>$all = count($file);<BR>for($i=0; $all>$i; $i++)<BR>{<BR>    $a = split('\|', chop($file[$i]));<BR>    $emot = explode('||', $file[$i]);<BR>    echo '<img src="'.$emot[0].'" border="0" onClick="emot('.$cmok[1].')" alt="'.$emot[1].'">';

}




W pliku emoty.txt są dane:
cmok.gif||[:*]||

I jak uruchomie strone z emotkami to wywala mi komunikat :"błąd składni".
Czy ktoś może coś poradzić?

Ten post edytował Gibcio2008 26.10.2008, 11:59:29
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
h4doken
post 27.10.2008, 14:43:15
Post #2





Grupa: Zarejestrowani
Postów: 3
Pomógł: 0
Dołączył: 26.10.2008

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


uzywaj echo "<br/>"; zamiast <BR>

Ten post edytował h4doken 27.10.2008, 14:43:58
Go to the top of the page
+Quote Post
grzesiek_g
post 27.10.2008, 14:56:58
Post #3





Grupa: Zarejestrowani
Postów: 249
Pomógł: 30
Dołączył: 18.07.2007

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


  1. <?php
  2. $file = file('includes/js/gibo_editor/emoty/emoty.txt');
  3. $all = count($file);
  4. for($i=0; $all>$i; $i++) {
  5.    $a = split('|', chop($file[$i]));
  6.    $emot = explode('||', $file[$i]);
  7.    echo '<img src="'.$emot[0].'" border="0" onClick="emot('.$cmok[1].')" alt="'.$emot[1].'">';
  8. }
  9. ?>

Widzę kod kopiowany z jakiejś strony, niestety skopiowały się także znaczniki html (<br>).
Chociaż mam nadzieję, że już sobie poradziłeś sam.


--------------------
Warsztat: Ubuntu 12.10, PHPStorm
http://vertoo.pl
Go to the top of the page
+Quote Post
Gibcio2008
post 29.10.2008, 13:43:15
Post #4





Grupa: Zarejestrowani
Postów: 54
Pomógł: 0
Dołączył: 26.10.2008

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


Mimo poprawionych błędów wyskakuje komunikat o błędzie składniowym.
Go to the top of the page
+Quote Post
grzesiek_g
post 29.10.2008, 14:10:20
Post #5





Grupa: Zarejestrowani
Postów: 249
Pomógł: 30
Dołączył: 18.07.2007

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


Podaj ten błąd, nikt tutaj nie wróży z fusów.


--------------------
Warsztat: Ubuntu 12.10, PHPStorm
http://vertoo.pl
Go to the top of the page
+Quote Post

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 Wersja Lo-Fi Aktualny czas: 24.07.2025 - 15:44