Jump to content

Recommended Posts

Ok so what I have is this and it's supposed to add the emoticon characters to the textarea upon clicking.. but it's not :s

 

<form method="post" action="update.php" name="share">
			<div align="center">3aglawie <input type="text" name="header" size="95" maxlength="35"/><br>
			<textarea id="story" rows="25" cols="80" maxlength="10000"></textarea><br>
<? $emote = array(
    "(hi)" => "hi.gif",
    "(f:))" => "fake_smile.gif",
":@" => "angry.png",
"(devil)" => "devil.gif",
"" => "lol.png",
"(lowpatience)" => "bomb.gif",
"O_O" => "O_O.gif",
";(" => "cry.gif",
"Zzz" => "sleeping.gif",
"(ninja)" => "ninja.gif",
"X_X" => "x_x.gif",
":*" => "kiss.gif",
"(angel)" => "angel.png",
);
foreach($emote as &$value) {
$temp = key($emote);
echo "<img src='emos/{$value}' title='$value' onclick='share.story.value=share.story.value + $temp' />"; 
}
?>

Link to comment
https://forums.phpfreaks.com/topic/240361-adding-text-via-image-clicking/
Share on other sites

Change the loop to this, as it makes more sense,

also the title should really be the key as well!

 

foreach($emote as $key => $value) {
  echo "<img src='emos/{$value}' title='$key' onclick='share.story.value=share.story.value + \"$key\"' />";
}

 

as for what image are being displayed after the post.. thats in some unposted script

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.