Hi

I've got a form which displays a list of users all that have a checkbox besides each name. i.e. Form 1:

<input type=\"checkbox\" name=\"email[]\" value=\"".$query_data["consultantID"]."\">

After selecting the recipients on this page(form 1) I want to go to an email form (form 2) where the user completes the text for his bulk email and any attachments before sending the email to all previously selected users. Obviously on this page I need to store the selected array of checkboxes on this page (email[]), probably in an hidden field so that it can be passes on with both the email text data and the attachments. When the user hits 'send' i'll then go to a confirmation page where i'll do something like the following:

foreach($_POST["email"] As $val){
//send out mail to each selected user
}

I just need to know how to store my array created on page 1 in an hidden field on page 2. Any ideas

Thanks

    same way as u thinking

    like
    <html>
    ...
    ....
    <body>
    ....
    ...
    <form>
    <?
    foreach($_POST["email"] As $val){
    echo "<input type=hidden name=email[] value='$val'>";
    }
    ?>
    ...
    ...
    </fomr>
    </body>
    </html>

      You could also use the implode() function so that you're essentially just storing a string. Then use explode() before you use it and you'll get your array back.

      eg. to store it in your hidden field
      $emails = implode("#", $emailArray);

      and to store it back in the array
      $emailArray = explode("#", $emails]);

      Hope this helps!

        Write a Reply...