Sorki za krzyk

to moj kod w php...dodawanie newsa :
<?php
# dodawanie do bazy
require_once('../mysql_connect.php');
$query = "INSERT INTO newsy (tytul, podtytul, zawartosc1, zawartosc2, zdjecie, data) VALUES ('$tytul', '$podtytul', '$zawartosc1', '$zawartosc2', '$zdjecie', NOW())";
if ($result == TRUE ) {
if($plik_dodany == TRUE) {
header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?menu=root&message_change=2"); } elseif(($userfile == '01') or ($userfile2 == '02') or ($userfile2 == '03') or ($userfile2 == '04') or ($userfile2 == '05') or ($userfile2 == '06') or ($userfile2== '07') or ($userfile2 == '08') or ($userfile2 == '09') or ($userfile2 == '10')) {
header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?menu=root&message_change=5"); } elseif($plik_dodany == FALSE) {
header("Location: http://" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/index.php?menu=root&message_change=4"); }
$tytul = NULL;
$podtytul = NULL;
$zawartosc1 = NULL;
$zawartosc2 = NULL;
$zdjecie = NULL;
$try_me = 'no';
} else {
$message_dodaj = ' - <font color=red>Błąd: '.mysql_error().'.</font>'; }
} elseif(($try_me == 'yes') or ($tytul != NULL) or ($podtytul != NULL) or ($zawartosc2 != NULL)) {
$message_dodaj = ' - <font color=red>Wypełnij wszystkie pola.</font>';
?>
oraz kod php odpowiadajacy za rozwijanie/zwijanie newsa
<?php
function zwinRozwin(idCat) {
var trs = document.getElementsByTagName("TR");
for(var i = 0; i < trs.length; i++) {
var trId
= trs
[i
].id
.substr(5
); if(parseInt(trId))
if(trId == idCat)
if(trs[i].style.display == "") trs[i].style.display = "none";
else trs[i].style.display = "";
?>
oraz drugi...