Link to home
Start Free TrialLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

How do I echo this?

I've got a loop of select statements that look like this:

<select name="1"></select>
<select name="2"></select>
<select name="3"></select>

<input type="hidden" name="count" value="3">

Then, when I attempt to process the form, I'm doing something like this:

$the_count=$_POST['final_count'];
$number=1;
for($x=1; $x<=$the_count; $x++)
{
      echo $_POST[$number];
      echo "<br>";
      $number=$number+1;
}

...it doesn't work. I get an error that says I have an undefined offset.

How can I get this to work?
SOLUTION
Avatar of Kim Walker
Kim Walker
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bruce Gust

ASKER

Thanks, guys! I've been able to glean some wisdom from more than one question and we're making progress. If you're willing, the next "snag" is represented by https://www.experts-exchange.com/questions/28937356/I'm-using-JQuery-I'm-submitting-a-form-and-opening-up-a-sidebar-How.html and I would welcome your input. Thanks!