Page 1 of 1
Smilies in my guestbook
Posted: Thu Jan 02, 2003 4:40 am
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");
Posted: Fri Jan 03, 2003 5:03 am
Posted: Mon Jan 06, 2003 4:51 pm
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.