Jump to content

[SOLVED] wan to know


bhavin12300

Recommended Posts

I'm guessing he means when creating a new post for example on these forums you get the smiley buttons above the textbox to type your post. Then if you click a smiley it inserts code for that in the textbox for you.

 

Not sure of a way to do it exactly becuase I'm tired but I think it's all done with javascript, you could prolly find something from the source of the new post page :P Just wanted to post to hopefully make your question clearer.

Link to comment
https://forums.phpfreaks.com/topic/59501-solved-wan-to-know/#findComment-295787
Share on other sites

Mosi is right. Javascript is used to insert the actual symbols (chars) into the text box. If you look hard enough in the source you will find the code.

 

Then in your php code. When your going to put the post into a database or file just use a str replace...

 

$post = $_POST['message'];

$newpost = str_replace(":)", "<img src=images/smiley_Face.jpg>:)</img>", $post);

 

That will take all the :)'s in the post and replace them with a link to the image!

 

Andy

Link to comment
https://forums.phpfreaks.com/topic/59501-solved-wan-to-know/#findComment-295809
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.