Witam. Mam pewien problem. Mianowice: kod Js jest interpretowany jako PHP. Jeżeli ktoś wie jak to naprawić byłbym bardzo wdzięczny.
Kod:
if ($perms>=3) {
echo '<li><button class= "btnaction" <script type="text/javascript">onclick="if(document.getElementById("bc") .style.display=="none") {document.getElementById("bc") .style.display=''}else{document.getElementById("bc") .style.display="none"}"</script>>Ogłoś</button></li>
<li class="divider"></li>';
}
Błąd:
PHP Parse error: syntax error, unexpected ''}else{document.getElementById' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';'