Q:

Input Form Array Using Loop, Email Subscription and PHP

I mainly have a form so that multiple names and email addresses can processed that this other PHP file processes the form so that it uses mail() to send to these emails. I used loop on the form so that the input fields are repeated to multiple entry then submit it. So the form looks like this:
<?php for ($i = 1; $i <= 10; $i++) { ?> // here's the PHP loop

<input type="text" 
  id="<?php echo 'firstname'.$i ?>" name="<?php echo 'firstname'.$i; ?>"
  value="<?php echo $_GET['firstname']; ?>" />  
      value?
<br/>
<input type="text" id="<?php echo 'lastname'.$i; ?>" 
  name="<?php echo 'lastname'.$i; ?>" 
  value="<?php echo $_GET['lastname']; ?>" />

<input type="text" id="<?php echo 'email'.$i; ?>" 
  name="<?php echo 'email'.$i; ?>" 
  value="<?php echo $_GET['email']; ?>"/>
<?php } ?> // END of loop

<input class="button" type="submit" value="Submit" name="submit" />

So now I'm twice confused on my second PHP file to process the above. How would I echo a message per email but using the values from inputed fields above. I'm not sure if I use explode as the inputed values are in array? In other words, each emails has to be sent a message to them separately. 
extract($_GET, EXTR_PREFIX_SAME, "get");

#construct email message
$email_message = "Name: ".$firstname." ".$lastname."
Email: ".$email;

#construct the email headers
$to = "email something";
$from = $_GET['email'];
$email_subject = "Registration Details";

#now mail
mail($to, $email_subject, $email_message, "From: ".$from);

echo "<b>Thank you ".$firstname." ".$lastname."! You are now registered.</b><br/><br/>";
echo "Here's your registration information:<br/><br/>";

echo "Email: ".$email."<br/>";

A:

Here is the concept: You need to name your input form with arrays to keep the value, so you can send a message separately. So, you would have a input form something like this:
for($i = 1; $i <= 10; $i++)
{
<input name="txtname[$i]">
<input name="txtnickname[$i]">
<input name="txtemail[$i]">
}

In your php code process the above form as follow:
   for($i = 1; $i <= 10; $i++)
   {
       mail($_POST['txtemail'][$i], 'Thx' . 
            $_POST['txtnickname'][$i], 'Body' . $_POST['txtname'][$i]
   }

Let me know if it work!

