<?php function filter(newc) { newc = newc.replace(/ /gi, " "); newc = newc.replace(/</gi, "<"); newc = newc.replace(/>/gi, ">"); newc = newc.replace(/\n/gi, "<br>"); // BBcode newc = newc.replace(//gi, "<b>"); newc = newc.replace(//gi, "</b>"); newc = newc.replace(//gi, "<i>"); newc = newc.replace(//gi, "</i>"); newc = newc.replace(/[ins]/gi, "<ins>"); newc = newc.replace(/[/ins]/gi, "</ins>"); newc = newc.replace(/[big]/gi, "<big>"); newc = newc.replace(/[/big]/gi, "</big>"); newc = newc.replace(/[small]/gi, "<small>"); newc = newc.replace(/[/small]/gi, "</small>"); newc = newc.replace(/[del]/gi, "<del>"); newc = newc.replace(/[/del]/gi, "</del>"); newc = newc.replace(/[code]/gi, "<br>"); newc = newc.replace(/[/code]/gi, "</p>"); newc = newc.replace(/(http|shhtp|ftp|news)(://)([^ ]*)/gi, "<a href="$1$2$3">[url]</a> "); return newc; } function show(chars, a, b) { box = document.getElementById(a); code = document.getElementsByName(b); box.innerHTML = filter(chars.value); code[0].value = box.innerHTML; } </script>'); //to jest form echo('<form id="html" method="post" name="tagi" action="'.$_SERVER['PHP_SELF'].'?kategoria='.$_GET['kategoria'].'&cid='.$_GET['cid'].'&tid='.$_GET['tid'].'&autor='.$_GET['autor'].'&tytul_topic='.$_GET['tytul_topic'].'"> <center><textarea name="tresc" rows="12" cols="80" maxlenght="1200" onkeyup="zliczaj_znaki(this.form)" onkeydown="zliczaj_znaki(this.form)" onkeyup="show(this, "html", "html_code");" style="background-color:#ECECEC; color:#000000; border: 1px solid red;">Tresc posta</textarea></center> <b>Kod html:</b><Br> <center><textarea id="html" name="html_code" rows="7" cols="40" style="background-color:#ECECEC; color:#000000; border: 1px solid red;" readonly></textarea></center> </form>'); ?>
I cos nie dziakla ogolnie bylbym wdzieczny jak ktos pokarze co robie zle i jeszcze jedno czy w jednym textarea moga byc 2 zdarzenia onkeyup bo jeden ma zliczac znaki a drugi podac kod html?
To jak pomoze ktos?
