Thread: Array woes
View Single Post
  #1 (permalink)  
Old December 31st, 2005, 12:50 AM
hillbilly geek hillbilly geek is offline
Registered User
Join Date: Dec 2005
Location: Todd, NC, USA.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to hillbilly geek
Default Array woes

I'm a newbie, working with php4.

I'm passing arrays from a form: a series of variables with the same
name like: Child[] and Age[]

I'm capturing them with:
        $Child[] = array($_POST['Child[]']);
        $Age[] = array($_POST['Age[]']) ;

then, I'm using:

$Count=0 ;
echo "<h3>Registering $numChildren Children</h3>" ;
                echo "<p>$Child[$Count], Age $Age[$Count], $Gender[$Count]<p>" ;
                echo "<p>Info: " . $Info[$Count] . "<p>" ;
                $CheckEmpty = "$Child[$Count]" ;
                $Count="$Count+1" ;

} while ($CheckEmpty!="") ;

if ($Count==1) echo "Not Applicable" ;
However, I get this result on the page: (for 2 entries):

Array, Age Array, Array
Info: Array

, Age ,

In other words: the first set of values are replaced with "Array"

And the second set of values don't show up.
I also tried it with three sets, and the third set didn't register at all
Help? Thanks!

Descartes goes into a restaurant and orders a cup of coffee. He sits for a while, drinking his coffee and reading the paper. A little while later, the waitress comes by and asks him if he would like another cup. He says "I think not" and disappears...
Reply With Quote