Onay kutularını Foreach değerleri dönmüyor

0 Cevap php

PHP 5.2 tamamen iyi çalıştı, önce bir komut dosyası yaptı. Geçenlerde benim arkadaşlarım sunucusu (sürüm PHP 4.4.9) üzerinden giderken Ama bazı eylemler gerektiği şekilde işe yaramadı fark ettim. Onay kutularını iade ne sonuç çılgın çıktı ...

This is the code I'm using: For the form:

<input type="checkbox" value="Box1" name="BoxGroup[]" />Box1
<input type="checkbox" value="Box2" name="BoxGroup[]" />Box2
<input type="checkbox" value="Box3" name="BoxGroup[]" />Box3

Action script için:

if($_POST['BoxGroup'] == true){ // If one of the checkboxes were checked...
    foreach($_POST['BoxGroup'] as $value){
    $BoxGroup .= ", ".$value; // Make the array into a string
    }
    $BoxGroup = substr($BoxGroup,2); // To skip ", " from the beginning of the $BoxGroup variable
}

Now, what this script does, is; when a user sends the form, it checks if one of the checkboxes were checked, and if so, it will make a string, like so: "value, value" etc. I insert these values to my database. When I preview what's been submitted to the database on a page, I get "ray / value / value", -- so only "ray" (as in "Array") was passed for the first box it seems.

Sistem operatörü ve ben de bunun için root şifresini (Ben deli olduğunu biliyorum) yok çünkü ne yazık ki, ben, PHP sunucunun sürümünü güncellemek olamaz.

Peki ben ne yapmalıyım?

0 Cevap