Smilies in my guestbook

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

nick_k
New php-forum User
New php-forum User
Posts: 34
Joined: Wed Dec 25, 2002 6:04 am
Location: The Netherlands
Contact:

Smilies in my guestbook

Postby nick_k » 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");
Thanks, Nick

nick_k
New php-forum User
New php-forum User
Posts: 34
Joined: Wed Dec 25, 2002 6:04 am
Location: The Netherlands
Contact:

Postby nick_k » Fri Jan 03, 2003 5:03 am

<bump>

meannate
New php-forum User
New php-forum User
Posts: 8
Joined: Mon Nov 04, 2002 12:06 pm
Location: West Los Angeles
Contact:

Postby meannate » 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.

_nathan


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 2 guests