Jump to content

Jons

New Members
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Jons's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Jons

    Form help

    Thanks, that makes sense. The way I had it, the name would be changing each time it cycled rather than putting them into an array? Not sure why I am still struggling with this.... <?PHP> $count="0"; While ($count<$num_rows){ ?> <div> <label><?echo"$Part1[$count]"?></label> <input type="checkbox" name="Part1[]" > </div> <? $count++; } <?PHP> $num_common_parts = "5"; $count="0"; While ($count<$num_common_parts){ $name = $_POST['Part1[$count]']; echo"Count $count Name $name<br>"; $count++; } Still gives no output.
  2. Jons

    Form help

    Hi, I have form that populates an array, but when I try and retrieve the contents of the array, they return as blank. Form code is $count="0"; While ($count<$num_rows){ ?> <div> <label><?echo"$Part1[$count]"?></label> <input type="checkbox" name="<?echo"$Part1[$count]"?>" > </div> <? $count++; } ?> <div> <button type="submit" class="btn" name="submit">Submit</button> </div> When I try and access the array with $name = $_POST[Part1[0]]; echo"1 $name<br>"; $name = $_POST[Part1[1]]; echo"2 $name<br>"; $name = $_POST[Part1[2]]; echo"3 $name<br>"; $name = $_POST[Part1[3]]; echo"4 $name<br>"; $name = $_POST[[Part1[4]]; echo"5 $name<br>"; I get the exact results I entered in the form, but if I try and use ; $num_rows="5"; $count="0"; While ($count<$num_rows){ $name = $_POST[Part1[$count]]; echo"1 $name<br>"; $count++; } I get blanks. Any assistance for a new coder appreciated. Jon
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.