Page 1 of 1

Smilies in my guestbook

Posted: Thu Jan 02, 2003 4:40 am
by nick_k
ok, what I want to do in my guestbook, is use smilies, so for example the visitor could type: and a smilie image would apear in its place. What I do, is save all the input ina file called notes.dat, and then just: include("notes.dat");
Thanks, Nick

Posted: Fri Jan 03, 2003 5:03 am
by nick_k

Posted: Mon Jan 06, 2003 4:51 pm
by meannate
I think you want to parse the input string, (the TEXTAREA for instance), for certain occurances, such as that smily.

So, once you've sent the form to be processed, use:

ereg_replace (":)", "<IMG SRC=\"images/smily.gif\">", $input);

Where $input is the input string from the previous page, which will find any occurance of :) and replace it with actual HTML code for placing an image.