Witam mam problem z przekazaniem tablicy do kodu PHP. Napiasałem skrypt JQUERY:
<script type="text/javascript">
$(document).ready(function(){
$("td.komorka").click(function() {
if($(this).css('background-color')== 'white')
{
$(this).css('background-color','red');
}
else if($(this).css('background-color')== 'red')
{
$(this).css('background-color','orange');
}
else
{
$(this).css('background-color','white');
}
})
$
('td.komorka').each(function(){ var tablica = [];
var id,nr;
if($(this).css('background-color')== 'white')
{
id=$(this).attr('id');
nr=parseInt(id);
tablica[nr]== 0;
}
else if($(this).css('background-color')== 'red')
{
id=$(this).attr('id');
nr=parseInt(id);
tablica[nr]== 1;
}
else if($(this).css('background-color')== 'orange')
{
id=$(this).attr('id');
nr=parseInt(id);
tablica[nr]== 2;
}
$.post('rezultat.php',{tab:tablica},function(data){})
)
})
});
I teraz chciałbym odebrać zmienną tablica[] w PHP.Robię to w ten sposób ale nie działa:
$tab=$_POST['tab[]'];
for($i=0;$i<230;$i++)
{
}