Bjour,
Voila, je débute quelque peu en PHP et j'ai un problème: Mon Golden Book est à peu près fonctionnel, mais j'aimerais ajouter une gestion de smileys. celle ci serait similaire à celle de ce forum, à savoir:
on clik sur l'image et ca rajoute un truc dans la textarea, et en suite, lors de l'affichage, on remplace les bouts de chaines rajoutées par les images. pour cela, j'ai trouvé le code suivant:
1. //anti-bug
2. Function smile_replace($text) {
3. $command = $text;
4. $command = str_replace(":D","<img src=images/smile/biggrin.gif>",$command);
5. $command = str_replace(":o","<img src='images/smile/eek.gif'>",$command);
6. $command = str_replace(":(","<img src='images/smile/frown.gif'>",$command);
7. $command = str_replace("<-","<img src='images/smile/left.gif'>",$command);
8. $command = str_replace(":@","<img src='images/smile/mad.gif'>",$command);
9. $command = str_replace("->","<img src='images/smile/right.gif'>",$command);
10. $command = str_replace("=)","<img src='images/smile/rolleyes.gif'>",$command);
11. $command = str_replace(":)","<img src='images/smile/smile.gif'>",$command);
12. $command = str_replace(":P","<img src='images/smile/tongue.gif'>",$command);
13. $command = str_replace("/!\\","<img src='images/smile/warning.gif'>",$command);
14. $command = str_replace(";)","<img src='images/smile/wink.gif'>",$command);
15. return $text;
16. }
et plus loin on a:
1. echo("
2. <p>$val[header]</p>
3. <p>smile_replace($val[body]);</p>
4. <hr>
5. ");
le pb c'est que à l'execution du truc, ca m'affiche:
au lieu de l'image, comment faire pour afficher l'image?