Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006

    Unanswered: Header location (mailto and url)

    I have a list of IDs (from a MySQL table) for sending emails and the user can select one or all or however many people they want to send an email. When they hit the "send" button, I want their default mail client to open up and have all the email addresses their. So far, I have this working. The "send" button sends the IDs to a separate PHP file that would pull the appropriate email addresses. It looks something like this:
    PHP Code:
    $emails = array();
    $i=0;$i<count($_POST['id']);$i++) {
    $_emails mysql_query(SELECT email FROM people WHERE id=$_POST['id'][$i]);
    header('Location: mailto:'.implode(",",$emails)); 
    I want the web page to stay on the list of email addresses. How can I redirect the blank page to the previous page? Two header() don't seem to work..

    Thank you.

  2. #2
    Join Date
    Oct 2006
    Otherwise you can use javascript also...hope it works.....after form submission get all the mail id and put them in a hidden form on the same page and submit the form with 'action=mailto:<allmailid>'.

    Hope it work.

  3. #3
    Join Date
    Nov 2006
    You can not send two location headers but you can change the form target to open in a new window. Which can open the mail client.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts