php - change property of button under certain condition -
i'm trying php only.
i have html buttons connected php array.
the array's arranged this:
$board=array( array("w","",""), array("","","w"), array("w","","") );
i use loop assign position of array variables. this:
$i=0; ($row=0;$row<3;$row++){ fop($column=0;$column<3;$column++){ $("b".$i)=$board[$row][$column]; $i++}}
this creates, example, $b0=$board[0][0].
on html side, have buttons named "b0". print if these buttons pressed, , has "w" assigned corresponding position in array:
for($e=0;$e<9;$e++){ if(isset($_post["b$e"])){ /*this button on html*/ if($("b".$e")=="w"){ /*this represents array positions*/ print "assigned"} }}
it prints "assigned" if "w" exists in array position(tested,it works)
what trying point, either change button value "hit" or change font color without refreshing every time.
say click button , has "w" assigned. want change property without wiping out other buttons went through property change. (something like, keeping button properties in session, if thats possible..)
so, don't want whole new set of buttons display every time submit button pressed, rather change button only. [button][button][button] [button][green button][button]...somethin that.
Comments
Post a Comment