Why the checkbox is not working? it echoing "interest Array"

$_POST['interest'] ;
            
     foreach($_POST as $field => $Value)
   {
    echo "$field,$Value<br>";
    
   }

Recommended Answers

All 7 Replies

If I use print_r function I get this array

Array ( [Gletuire] => Gletuire [Montaj parchet] => Montaj parchet [Placare faianta integral] => Placare faianta integral ) 1Inaltime_pereti,2.5
Array ( [Gletuire] => Gletuire [Montaj parchet] => Montaj parchet [Placare faianta integral] => Placare faianta integral ) 1Latime,3
Array ( [Gletuire] => Gletuire [Montaj parchet] => Montaj parchet [Placare faianta integral] => Placare faianta integral ) 1Lungime,10
Array ( [Gletuire] => Gletuire [Montaj parchet] => Montaj parchet [Placare faianta integral] => Placare faianta integral ) 1Inaltime_faianta,2.5
Array ( [Gletuire] => Gletuire [Montaj parchet] => Montaj parchet [Placare faianta integral] => Placare faianta integral ) 1Faianta_partial,0
Array ( [Gletuire] => Gletuire [Montaj parchet] => Montaj parchet [Placare faianta integral] => Placare faianta integral ) 1interest,Array
Array ( [Gletuire] => Gletuire [Montaj parchet] => Montaj parchet [Placare faianta integral] => Placare faianta integral ) 1

What to do with this?

Member Avatar for rajarajan2017
<?php
foreach($_POST['interest'] as $index => $val){
echo "test[".$index."]=".$val;
}
?>

Test this.

it echoing
test[Gletuire]=Gletuiretest[Placare faianta integral]=Placare faianta integraltest[Placare tavan gips carton]=Placare tavan gips cartontest[Vopsitorie lavabila]=Vopsitorie lavabila?

You deserve a cold good tasty beer : Thank you. Still, why it neded index remark?

Member Avatar for rajarajan2017

Actually there is no need of test. I think already you got the result. No need of index anything it would be, actually in the second post itself you have result.

I reaad from 7 am till 11pm from weeks and still get a lot of headeaks.

Member Avatar for rajarajan2017

Oh! know, you must study array before using these. If you seen array before then you understand what it shows? anyways success is coming after lot of mistakes.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.