Jump to content

[SOLVED] form/array processing - unknown number of $_POST


mreish

Recommended Posts

I'm building a "Tell a Friend" type script where the user can add input fields so that when they hit submit, there could be 1 or 100 input fields.

 

I can see each field using this:

 


echo print_r($_POST, true);

 

Which gives the output:

 


     Array
     (
         [personalMessage] => message text goes here.
         [email1] => [email protected]
         [email2] => [email protected]
         [email3] => 
         [email4] => 
         [email5] => 
         [email6] => 
         [description] => Tell a friend 
     )

 

But because there are other elements in the $_POST array (such as personalMessage and description) I'm not sure how to parse for the email elements.

 

Any constructive input or tips is most welcome!

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.