$banip = is_array($_POST['ban']) ? $_POST['ban'] : array(); Ane rašė: > Yra php dalis, kur is POST ateina du masyvai su checkbox reiksmemis > Beda tame, jei viena is tu dvieju post masyvu buna tuscias, foreach > keikias. Koki tikrinima butu galima bandyt? if..else ? > Jeigu abu masyvai pilni, viskas normlaiai > > $banip = $_POST['ban'] ; > $rmip = $_POST['rm'] ; > foreach ($banip as &$value) { > //exec (" iptables -A ids -s $value -j DROP "); > mysql_query("INSERT INTO bannedips SELECT * FROM newips WHERE ip = > '$value'"); > mysql_query("DELETE FROM newips WHERE ip='$value'"); > } > foreach ($rmip as &$valu) { > //exec (" iptables -A ids -s $value -j DROP "); > mysql_query("DELETE FROM newips WHERE ip='$valu'"); > }