Witam,
Oto kod formularza:
script.js

function wstaw(start_tag,stop_tag){
   var okno = document.getElementById("content_input");
   if(!okno.setSelectionRange) {
      var selected = document.selection.createRange().text; 
      if(selected.length <= 0) {
         okno.value +=start_tag + stop_tag;
      } else {
         document.selection.createRange().text =  start_tag + selected + stop_tag;
      }
   } else {
      var pretext = okno.value.substring(0, okno.selectionStart);
      var codetext = start_tag + okno.value.substring(okno.selectionStart,
      okno.selectionEnd) + stop_tag;
      var posttext = okno.value.substring(okno.selectionEnd, okno.value.length)
      if(codetext == start_tag + stop_tag) {
         okno.value += start_tag + stop_tag;
      } else {
         okno.value = pretext + codetext + posttext;
      }
   }
   okno.focus ();
}

formularz:

<script src="script.js"></script>
<form action="?" method="post">
   

<?php

$result = mysql_query('SELECT * FROM armors WHERE type like "%ody" ORDER BY armor_id ')or die('Nie mogę połączyć się z bazą danych: '.mysql_error());
while ($row = mysql_fetch_assoc($result))
	{
	$icon = unserialize($row['icon']);
		$stats = unserialize($row['stats']);
	

?>
   <input type="button"  onclick="wstaw('<?php echo show_icona(unserialize($row['icon'])) ?>','a')">

<?php
}

?>
   <input type="button" value="u" onclick="wstaw('a','[u]','[/u]')">
   <input type="button" value="s" onclick="wstaw('[s]','[/s]')">
   <input type="button" value="link" onclick="wstaw('[url]','[/url]')">
   <input type="button" value="obrazek" onclick="wstaw('[img]','[/img]')">
   <input type="button" value="cytat" onclick="wstaw('[quote]','[/quote]')">
   <input type="button" value="kod" onclick="wstaw('[code]','[/code]')">
   </div>
   <label>Treść</label>
   <textarea id="content_input" name="content"></textarea>
   <br/>
   <input type="submit" name="submit" value="Wyślij">
</form>

Jak widac w tym inpucie: <input type="button" onclick="wstaw('&lt;?php echo show_icon(unserialize($row['icon'])) ?">','a')">

Mam funkcję zaincludowaną z innego pliku, w pętli. Chciałbym, aby po kliknięciu w button do formularza wskakiwał kod tej funkcji. Niestety całość nie działa, gdyż jest parsowana i kod nie jest wyświetlany w postaci tekstu. Jak to naprawić?
Zawartość funkcji w inpucie:

function show_icon($icon)
{
	return '<div class="icon" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-attachment: scroll; background-size: auto; background-origin: padding-box; background-clip: border-box; background-color: transparent; width: '.$icon['graphic']['size']['x'].'px; height: '.$icon['graphic']['size']['y'].'px; display: block; overflow-x: hidden; overflow-y: hidden; background-image: url(http://mf3.pl/static/'.$icon['graphic']['src'].'); background-repeat: no-repeat; background-position: -'.($icon['graphic']['size']['x'] * $icon['source']['x']).'px -'.($icon['graphic']['size']['y'] * $icon['source']['y']).'px">';
}