[PHP] newbie - how to receive/iterate posted arrays
Hello early birds, I am going round and round the docs and list posts I saved on this topic... but I am still stumped. Kindly show me what I am missing. I want to simply send an array of vars via a post form to my receiving script. I've got simple inputs like this: input name=tmbsToiterate[muir_beach_tmb] type=hidden value=muir_beach_tmb / input name=tmbsToiterate[ruby_mountain_tmb] type=hidden value=ruby_mountain_tmb / they post to the script with this: (and this is the line giving the error)- foreach($_POST['$tmbsToiterate'] as $value) { The error is Warning: Invalid argument supplied for foreach() Seems so simple, but I can't get it... What am I doing wrong? -Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie - how to receive/iterate posted arrays
Hi, On Mon, Sep 1, 2008 at 9:25 AM, Govinda [EMAIL PROTECTED] wrote: Hello early birds, I am going round and round the docs and list posts I saved on this topic... but I am still stumped. Kindly show me what I am missing. I want to simply send an array of vars via a post form to my receiving script. I've got simple inputs like this: input name=tmbsToiterate[muir_beach_tmb] type=hidden value=muir_beach_tmb / input name=tmbsToiterate[ruby_mountain_tmb] type=hidden value=ruby_mountain_tmb / they post to the script with this: (and this is the line giving the error)- foreach($_POST['$tmbsToiterate'] as $value) { // Maybe like this, but i'm not sure, try to do a var_dump( $_POST ) and see what is inside ;) foreach($_POST['tmbsToiterate'] as $value) { The error is Warning: Invalid argument supplied for foreach() Seems so simple, but I can't get it... What am I doing wrong? -Govinda -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Thanks for your attention, Diogo Neves Web Developer @ SAPO.pt by PrimeIT.pt
Re: [PHP] newbie - how to receive/iterate posted arrays
Thanks Diogo! , and other who replied! You nailed it (Of course! you would say.) I didn't reply sooner as we had a power out (just enough to get me to go to bed already ;-) -G On Sep 1, 2008, at 2:31 AM, Diogo Neves wrote: foreach($_POST['$tmbsToiterate'] as $value) { foreach($_POST['tmbsToiterate'] as $value) { -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php