if(isset($_POST['dino_c']) AND isset($_POST['dino_box']) AND isset($dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$_POST['dino_box']])){
if(....){
if(($pop>(0-1+$dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$_POST['dino_box']][4])) AND ($resource[0]>(0-1+$dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$a_dino[$_POST['dino_box']]][5] -1)) AND ($resource[1]>(0-1+$dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$a_dino[$_POST['dino_box']]][6] -1)) AND ($resource[2]>(0-1+$dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$a_dino[$_POST['dino_box']]][7] -1))){
.
.
.
.
$pop = $pop - $dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$_POST['dino_box']][4];
$pop_consum = $pop_consum + $dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$_POST['dino_box']][4];
$resource[0] = 0 + $dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$a_dino[$_POST['dino_box']]][5];
$resource[1] = 0 + $dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$a_dino[$_POST['dino_box']]][6];
$resource[2] = 0 + $dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$a_dino[$_POST['dino_box']]][7];
$dino_add[$a_dino[$_POST['dino_c']][1]-1] = 0 + $dino_recruit[$a_dino[$_POST['dino_c']][1]][$a_dino[$_POST['dino_c']][3]][$a_dino[$_POST['dino_box']]][0];
.
.
.
.
}
}
}
それは私のコードであり、私がそれを使用するとき:
> undefined index:4 in .... ajax.php on line 672 => here line 3
> undefined index: in .... ajax.php on line 672 => here line 3
> undefined index:4 in .... ajax.php on line 672 => here line 3
> undefined index: in .... ajax.php on line 672 => here line 3
> undefined index:4 in .... ajax.php on line 672 => here line 3
> undefined index: in .... ajax.php on line 672 => here line 3
> undefined index:4 in .... ajax.php on line 679 => here line 10
> undefined index: in .... ajax.php on line 679 => here line 10
....
> undefined index:4 in .... ajax.php on line 682 => here line 13
> undefined index: in .... ajax.php on line 682 => here line 13
isset() を使用してデータをチェックします。すべてが設定されている場合、なぜエラーが発生するのですか?
このコードには 2 つの $_POST があり、それらは 1 行目でチェックされ、他のデータは配列であり、100 回チェックしてもエラーの場所がわかりません。8 行目と 9 行目を見てください。エラーはありません。構造は他の路線と似ていますが、なぜですか?