Output to another window

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • astromac

    Output to another window

    I'm new to php and was wondering if the following was possible...

    I would like to have a list of items loaded from a text file, process
    each item in the list and then return the processed result to a new
    window so that the new window displays the results, one by one, until
    it is done processing the list.

    I considered javascript but the whole client-side/server-side divide
    seems difficult for this newbie to figure out. Is what I want possible?

  • NC

    #2
    Re: Output to another window

    astromac wrote:[color=blue]
    >
    > I would like to have a list of items loaded from a text file, process
    > each item in the list and then return the processed result to a new
    > window so that the new window displays the results, one by one, until
    > it is done processing the list.
    >
    > I considered javascript but the whole client-side/server-side divide
    > seems difficult for this newbie to figure out. Is what I want possible?[/color]

    Yes (with some JavaScript), but why bother?

    Cheers,
    NC

    Comment

    • Al

      #3
      Re: Output to another window

      astromac wrote:[color=blue]
      > I'm new to php and was wondering if the following was possible...
      >
      > I would like to have a list of items loaded from a text file, process
      > each item in the list and then return the processed result to a new
      > window so that the new window displays the results, one by one, until
      > it is done processing the list.
      >
      > I considered javascript but the whole client-side/server-side divide
      > seems difficult for this newbie to figure out. Is what I want possible?[/color]

      Unfortunately you don't give a lot of details here. It'd be nice to
      know what the processing IS exactly. And why you need a new blank
      window. What's wrong with the window that the page loads in? How is the
      page to be called? Just loading it or is there a form to submit?

      Still look into the output buffering and flush stuff on www.php.net for
      the "processing one by one" thing. And maybe if it's a form submittal
      look into doing <form target="_blank" ... > and if it's not you'll
      pretty much HAVE to use javascript to open that new window.

      Comment

      • astromac

        #4
        Re: Output to another window

        Fair enough. I work at a church and my boss wanted me to write a
        script to send emails to the congregation and have the progress of the
        emailing show up in another window. As far as why bother, it's what I
        was asked to do. As far as why not output the results in the same
        window, I didn't like how it printed the output at the top of the form
        and kept pushing the form down. I'm a civil engineer by trade so I'm
        sure the code is stupidly written and inefficient so be kind (I'm new
        to PHP and javascript). BTW, you're not helping a spammer - this is
        for folks who attend our conferences every year and have requested an
        HTML brochure rather than a printed brochure.

        Anyway - here's the code in order to provide you with detail.

        <?php
        $email_from = isset($_POST['email_from']) ?
        htmlentities($_ POST['email_from']) : '';
        $email_from_nam e = isset($_POST['email_from_nam e']) ?
        htmlentities($_ POST['email_from_nam e']) : '';
        $email_subject = isset($_POST['email_subject']) ?
        htmlentities($_ POST['email_subject']) : '';
        $email_delay = isset($_POST['email_delay']) ?
        htmlentities($_ POST['email_delay']) : '';
        $errors['cant_open_mess age'] = "<script type=\"text/javascript\">al ert
        (\"Can't Open Message File\");</script>";
        $errors['cant_open_addr ess'] = "<script type=\"text/javascript\">al ert
        (\"Can't Open Address File\");</script>";

        function showform ($_email_from, $_email_subject , $_address_file,
        $_message_file, $_email_delay, $_mime_type) {
        print<<<_HTML_
        <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
        <html lang="en">
        <head>
        <meta http-equiv="content-type" content="text/html;
        charset=iso-8859-1">
        <title>Conferen ce Email Form</title>
        <meta name="generator " content="BBEdit 8.2">
        <script type="text/javascript">
        var newListWindow;
        var newTextWindow;
        function makeListWindow( ) {
        if (!newListWindow || newListWindow.c losed) {
        newListWindow = window.open("", "popList",
        "resizeable,scr ollbars,height= 400,width=400") ;
        //delay writing until window exists in IE/Windows
        setTimeout("wri teListWindow()" , 50);
        }
        else if (newListWindow. focus) {
        newListWindow.f ocus();
        }
        }
        function startListWindow () {
        var newContent = "<html><head><t itle>Successful
        Sends</title></head>";
        newContent += "<body><h1>Succ essful Sends</h1><br/>";
        newListWindow.d ocument.write(n ewContent);
        }
        </script>
        <style type="text/css">
        body {
        color: #00008B;
        font-family: "Trebuchet MS", sans-serif;
        font-size: 1em;
        }
        h1 {
        color: #FFFFFF;
        background-color: #00008B;
        text-indent: 6px;
        }
        form {
        border: 1px dashed #00008B;
        padding: 3px 6px 3px 6px;
        background-color: #EAF6FF;
        }
        form p {
        clear: left;
        margin: 0;
        padding: 0;
        padding-top: 5px;
        }
        form p label{
        float: left;
        width: 30%;
        }
        input.txt {
        width: 250px;
        color: #00008B;
        background-color: #ADD8E6;
        border: 1px solid #00008B;
        font-weight: bold;
        }
        input.fil {
        color: #00008B;
        background-color: #ADD8E6;
        border: 1px solid #00008B;
        font-weight: bold;
        }
        input.del {
        width: 40px;
        color: #00008B;
        background-color: #ADD8E6;
        border: 1px solid #00008B;
        font-weight: bold;
        }
        input.btn {
        color: #00008B;
        background-color: #ADD8E6;
        border: 1px outset #00008B;
        font-weight: bold;
        }
        </style>
        </head>
        <body>
        <h1>Conferenc e Email Form</h1>
        <form enctype="multip art/form-data" method="POST"
        action="$_SERVE R[PHP_SELF]">
        <p>
        <label for="from">Emai l From Address:</label>
        <input type="text" id="from" name="email_fro m" value="$_email_ from"
        class="txt">
        </p>
        <p>
        <label for="name">Emai l From Name:</label>
        <input type="text" id="name" name="email_fro m_name"
        value="$_email_ from_name" class="txt">
        </p>
        <p>
        <label for="subject">E mail Subject:</label>
        <input type="text" id="subject" name="email_sub ject"
        value="$_email_ subject" class="txt">
        </p>
        <p>
        <label for="list">Addr ess List:</label>
        <input type="file" size="32" id="list" name="address_f ile"
        class="fil">
        </p>
        <p>
        <label for="message">M ail Message:</label>
        <input type="file" size="32" id="message" name="message_f ile"
        class="fil">
        </p>
        <p>
        <label for="delay">Del ay Between Email Sends:</label>
        <input type="text" id="delay" name="email_del ay"
        value="$_email_ delay" class="del"> minutes
        </p>
        <p>
        <label for="mime">Mess age Type:</label>
        <input type="radio" id="mime" name="mime_type " value="html"> HTML
        <input type="radio" id="mime" name="mime_type " value="text"> Plain
        Text
        </p>
        <br/>
        <br/>
        <p>
        Send Email<br/>
        <input type="submit" value="Process Now" name="submit" class="btn">
        &nbsp;&nbsp;
        <input type="hidden" name="submit_ch eck" value="1">
        </p>
        </form>
        </body>
        </html>
        _HTML_;
        }

        function emailcheck ($_emailaddr) {
        # Trim out 'null' characters
        $_emailaddr = ereg_replace("\ t","",$_emailad dr);
        $_emailaddr = ereg_replace("\ r","",$_emailad dr);
        $_emailaddr = ereg_replace("\ n","",$_emailad dr);
        $_emailaddr = ereg_replace(" ","",$_emailadd r);

        # Email addresses are not case sensitive
        $_emailaddr = strtolower($_em ailaddr);

        # Must contain '@' and '.'
        if ((!ereg("@",$_e mailaddr)) || (!ereg(".",$_em ailaddr))) {
        $valid = "0";
        }

        # Must be at least 6 characters long (x@y.com or x@y.au)
        elseif (strlen($_email addr) < 6) {
        $valid = "0";
        }

        else {
        # Split on the @ sign
        $parts = split("@", $_emailaddr, 2);

        # First part is user
        $user = $parts[0];

        # Second part is domain
        $domain = $parts[1];

        # Domain must contain at least 1 dot.
        if (!ereg("\\.",$d omain)) {
        $valid = "0";
        }

        # Must be a least 3 characters (z.com or z.au)
        elseif (strlen($domain ) < 3) {
        $valid = "0";
        }

        # May not start with a dot
        elseif (ereg("^\\.",$d omain)) {
        $valid = "0";
        }

        # May not have more than one dot in sequence
        elseif (ereg("\\.\\.", $domain)) {
        $valid = "0";
        }

        else {
        # User must be at least 1 character long
        if (strlen($user) < 1) {
        $valid = "0";
        }

        # User cannot contain a comma
        elseif (ereg("\\,", $user)) {
        $valid = "0";
        }

        else {
        # Split on the . character
        $parts = split("\\.", $domain);

        # There must be at least two parts to a domain (a sub domain would
        have 3 - a.b.com)
        if (count($parts) < 2) {
        $valid = "0";
        }

        else {
        # First part is domain name
        $name_at = count($parts) - 2;
        $name = $parts[$name_at];

        # Second part is domain extention
        $ext_at = count($parts) - 1;
        $ext = $parts[$ext_at];
        $first_name = substr($name, 0, 1);

        # Name must be at least one character
        if (strlen($name) < 1) {
        $valid = "0";
        }

        # Name cannot be more than 26 characters
        if (strlen($name) > 26) {
        $valid = "0";
        }

        # Extention must be 2 or 3 characters (.nu - .com)
        elseif ((strlen($ext) > 3) || (strlen($ext) < 2)) {
        $valid = "0";
        }

        # Domain can only contain the following characters
        elseif (strspn($name, "abcdefghijklmn opqrstuvwxyz012 3456789-.") !=
        strlen($name)) {
        $valid = "0";
        }

        # Domain can only start with the following characters
        elseif (strspn($first_ name, "abcdefghijklmn opqrstuvwxyz") < 1) {
        $valid = "0";
        }

        # Extension can only contain the follow characters
        elseif (strspn($ext, "abcdefghijklmn opqrstuvwxyz") !=
        strlen($ext)) {
        $valid = "0";
        }
        else {
        $valid = "1";
        }
        }
        }
        }
        }
        return $valid;
        }

        function sendmail ($_address_file , $_email_from, $_email_from_na me,
        $_email_subject , $_email_message , $_mime_type) {
        $f = 0;
        print "<script
        type=\"text/javascript\">ma keListWindow(); startListWindow ();</script>";

        foreach ($_address_file as $key => $value) {
        $pieces = explode(",", $value);
        foreach ($pieces as $piece_no => $piece_value) {
        if ($piece_no == 0) {
        $lastname[$key] = $piece_value;
        }

        if ($piece_no == 1) {
        $firstname[$key] = $piece_value;
        }

        if ($piece_no == 2) {
        $email[$key] = $piece_value;
        }
        }
        $fullname = $firstname[$key].' '.$lastname[$key];
        if ($fullname != ' ') {
        $to = '"'.$fullname.' " <'.$email[$key].'>';
        }
        else {
        $to = $email[$key];
        }
        if ($_email_from_n ame != '') {
        $from = '"'.$_email_fro m_name.'" <'.$_email_from .'>';
        }
        else {
        $from = $_email_from;
        }

        if ($_mime_type == "html") {
        $headers = "From: $from\r\n";
        $headers .= "MIME-Version: 1.0\r\n";
        $boundary = md5(uniqid(rand (), true));
        $headers .= "Content-Type: multipart/mixed" .
        "; boundary = $boundary\r\n\r \n";
        $headers .= "This is a MIME encoded message.\r\n\r\ n";
        $headers .= "--$boundary\r\n" .
        "Content-Type: text/html; charset=ISO-8859-1\r\n" .
        "Content-Transfer-Encoding: 7bit\r\n\r\n";
        }

        else {
        $headers = "From: $from\r\n";
        }

        $success = mail ($to, $_email_subject , $_email_message , $headers);
        if ($success) {
        $popup_address = "sent: ".$to."<br/>";
        print "<script type=\"text/javascript\">va r popupAddress = \"<?php
        echo $popup_address;
        ?>\";newListWin dow.document.wr ite(popupAddres s);</script>";
        sleep ($_emaildelay * 60);
        }
        else {
        $failed[$f] = $to;
        $f++;
        }
        }

        if ($failed > 0) {
        print '<script type=\"text/javascript\">al ert (\"Failure Sending
        Email\");</script>';
        print "The following addresses did not send:\r\n";
        foreach ($failed as $key => $value) {
        print $failed[$key]."\r\n";
        }
        }
        }

        if ($_POST['submit_check']) {
        $valid = emailcheck ($email_from);
        if (!$valid) {
        print "<script type=\"text/javascript\">al ert('Please enter a valid
        email address in the EMAIL FROM field');</script>";
        }
        else {
        $email_message =
        file_get_conten ts($_FILES['message_file']['tmp_name']) or
        die($errors['cant_open_mess age']);
        $address_file = file($_FILES['address_file']['tmp_name']) or
        die($errors['cant_open_addr ess']);
        sendmail ($address_file, $email_from, $email_from_nam e,
        $email_subject, $email_message, $_POST['mime_type']);
        }
        showform ($email_from, $email_subject,
        $_FILES['address_file']['name'], $_FILES['message_file']['name'],
        $email_delay, $_POST['mime_type']);
        }
        else {
        showform ($email_from, $email_subject,
        $_FILES['address_file']['name'], $_FILES['message_file']['name'],
        $email_delay, $_POST['mime_type']);
        }
        ?>

        Comment

        • Jim Michaels

          #5
          Re: Output to another window

          most people have popup blockers which will cancel the new window. google
          and yahoo toolbar will do this.

          "astromac" <obearsstate@gm ail.com> wrote in message
          news:1138817935 .934711.314490@ o13g2000cwo.goo glegroups.com.. .[color=blue]
          > Fair enough. I work at a church and my boss wanted me to write a
          > script to send emails to the congregation and have the progress of the
          > emailing show up in another window. As far as why bother, it's what I
          > was asked to do. As far as why not output the results in the same
          > window, I didn't like how it printed the output at the top of the form
          > and kept pushing the form down. I'm a civil engineer by trade so I'm
          > sure the code is stupidly written and inefficient so be kind (I'm new
          > to PHP and javascript). BTW, you're not helping a spammer - this is
          > for folks who attend our conferences every year and have requested an
          > HTML brochure rather than a printed brochure.
          >
          > Anyway - here's the code in order to provide you with detail.
          >
          > <?php
          > $email_from = isset($_POST['email_from']) ?
          > htmlentities($_ POST['email_from']) : '';
          > $email_from_nam e = isset($_POST['email_from_nam e']) ?
          > htmlentities($_ POST['email_from_nam e']) : '';
          > $email_subject = isset($_POST['email_subject']) ?
          > htmlentities($_ POST['email_subject']) : '';
          > $email_delay = isset($_POST['email_delay']) ?
          > htmlentities($_ POST['email_delay']) : '';
          > $errors['cant_open_mess age'] = "<script type=\"text/javascript\">al ert
          > (\"Can't Open Message File\");</script>";
          > $errors['cant_open_addr ess'] = "<script type=\"text/javascript\">al ert
          > (\"Can't Open Address File\");</script>";
          >
          > function showform ($_email_from, $_email_subject , $_address_file,
          > $_message_file, $_email_delay, $_mime_type) {
          > print<<<_HTML_
          > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
          > "http://www.w3.org/TR/html4/loose.dtd">
          > <html lang="en">
          > <head>
          > <meta http-equiv="content-type" content="text/html;
          > charset=iso-8859-1">
          > <title>Conferen ce Email Form</title>
          > <meta name="generator " content="BBEdit 8.2">
          > <script type="text/javascript">
          > var newListWindow;
          > var newTextWindow;
          > function makeListWindow( ) {
          > if (!newListWindow || newListWindow.c losed) {
          > newListWindow = window.open("", "popList",
          > "resizeable,scr ollbars,height= 400,width=400") ;
          > //delay writing until window exists in IE/Windows
          > setTimeout("wri teListWindow()" , 50);
          > }
          > else if (newListWindow. focus) {
          > newListWindow.f ocus();
          > }
          > }
          > function startListWindow () {
          > var newContent = "<html><head><t itle>Successful
          > Sends</title></head>";
          > newContent += "<body><h1>Succ essful Sends</h1><br/>";
          > newListWindow.d ocument.write(n ewContent);
          > }
          > </script>
          > <style type="text/css">
          > body {
          > color: #00008B;
          > font-family: "Trebuchet MS", sans-serif;
          > font-size: 1em;
          > }
          > h1 {
          > color: #FFFFFF;
          > background-color: #00008B;
          > text-indent: 6px;
          > }
          > form {
          > border: 1px dashed #00008B;
          > padding: 3px 6px 3px 6px;
          > background-color: #EAF6FF;
          > }
          > form p {
          > clear: left;
          > margin: 0;
          > padding: 0;
          > padding-top: 5px;
          > }
          > form p label{
          > float: left;
          > width: 30%;
          > }
          > input.txt {
          > width: 250px;
          > color: #00008B;
          > background-color: #ADD8E6;
          > border: 1px solid #00008B;
          > font-weight: bold;
          > }
          > input.fil {
          > color: #00008B;
          > background-color: #ADD8E6;
          > border: 1px solid #00008B;
          > font-weight: bold;
          > }
          > input.del {
          > width: 40px;
          > color: #00008B;
          > background-color: #ADD8E6;
          > border: 1px solid #00008B;
          > font-weight: bold;
          > }
          > input.btn {
          > color: #00008B;
          > background-color: #ADD8E6;
          > border: 1px outset #00008B;
          > font-weight: bold;
          > }
          > </style>
          > </head>
          > <body>
          > <h1>Conferenc e Email Form</h1>
          > <form enctype="multip art/form-data" method="POST"
          > action="$_SERVE R[PHP_SELF]">
          > <p>
          > <label for="from">Emai l From Address:</label>
          > <input type="text" id="from" name="email_fro m" value="$_email_ from"
          > class="txt">
          > </p>
          > <p>
          > <label for="name">Emai l From Name:</label>
          > <input type="text" id="name" name="email_fro m_name"
          > value="$_email_ from_name" class="txt">
          > </p>
          > <p>
          > <label for="subject">E mail Subject:</label>
          > <input type="text" id="subject" name="email_sub ject"
          > value="$_email_ subject" class="txt">
          > </p>
          > <p>
          > <label for="list">Addr ess List:</label>
          > <input type="file" size="32" id="list" name="address_f ile"
          > class="fil">
          > </p>
          > <p>
          > <label for="message">M ail Message:</label>
          > <input type="file" size="32" id="message" name="message_f ile"
          > class="fil">
          > </p>
          > <p>
          > <label for="delay">Del ay Between Email Sends:</label>
          > <input type="text" id="delay" name="email_del ay"
          > value="$_email_ delay" class="del"> minutes
          > </p>
          > <p>
          > <label for="mime">Mess age Type:</label>
          > <input type="radio" id="mime" name="mime_type " value="html"> HTML
          > <input type="radio" id="mime" name="mime_type " value="text"> Plain
          > Text
          > </p>
          > <br/>
          > <br/>
          > <p>
          > Send Email<br/>
          > <input type="submit" value="Process Now" name="submit" class="btn">
          > &nbsp;&nbsp;
          > <input type="hidden" name="submit_ch eck" value="1">
          > </p>
          > </form>
          > </body>
          > </html>
          > _HTML_;
          > }
          >
          > function emailcheck ($_emailaddr) {
          > # Trim out 'null' characters
          > $_emailaddr = ereg_replace("\ t","",$_emailad dr);
          > $_emailaddr = ereg_replace("\ r","",$_emailad dr);
          > $_emailaddr = ereg_replace("\ n","",$_emailad dr);
          > $_emailaddr = ereg_replace(" ","",$_emailadd r);
          >
          > # Email addresses are not case sensitive
          > $_emailaddr = strtolower($_em ailaddr);
          >
          > # Must contain '@' and '.'
          > if ((!ereg("@",$_e mailaddr)) || (!ereg(".",$_em ailaddr))) {
          > $valid = "0";
          > }
          >
          > # Must be at least 6 characters long (x@y.com or x@y.au)
          > elseif (strlen($_email addr) < 6) {
          > $valid = "0";
          > }
          >
          > else {
          > # Split on the @ sign
          > $parts = split("@", $_emailaddr, 2);
          >
          > # First part is user
          > $user = $parts[0];
          >
          > # Second part is domain
          > $domain = $parts[1];
          >
          > # Domain must contain at least 1 dot.
          > if (!ereg("\\.",$d omain)) {
          > $valid = "0";
          > }
          >
          > # Must be a least 3 characters (z.com or z.au)
          > elseif (strlen($domain ) < 3) {
          > $valid = "0";
          > }
          >
          > # May not start with a dot
          > elseif (ereg("^\\.",$d omain)) {
          > $valid = "0";
          > }
          >
          > # May not have more than one dot in sequence
          > elseif (ereg("\\.\\.", $domain)) {
          > $valid = "0";
          > }
          >
          > else {
          > # User must be at least 1 character long
          > if (strlen($user) < 1) {
          > $valid = "0";
          > }
          >
          > # User cannot contain a comma
          > elseif (ereg("\\,", $user)) {
          > $valid = "0";
          > }
          >
          > else {
          > # Split on the . character
          > $parts = split("\\.", $domain);
          >
          > # There must be at least two parts to a domain (a sub domain would
          > have 3 - a.b.com)
          > if (count($parts) < 2) {
          > $valid = "0";
          > }
          >
          > else {
          > # First part is domain name
          > $name_at = count($parts) - 2;
          > $name = $parts[$name_at];
          >
          > # Second part is domain extention
          > $ext_at = count($parts) - 1;
          > $ext = $parts[$ext_at];
          > $first_name = substr($name, 0, 1);
          >
          > # Name must be at least one character
          > if (strlen($name) < 1) {
          > $valid = "0";
          > }
          >
          > # Name cannot be more than 26 characters
          > if (strlen($name) > 26) {
          > $valid = "0";
          > }
          >
          > # Extention must be 2 or 3 characters (.nu - .com)
          > elseif ((strlen($ext) > 3) || (strlen($ext) < 2)) {
          > $valid = "0";
          > }
          >
          > # Domain can only contain the following characters
          > elseif (strspn($name, "abcdefghijklmn opqrstuvwxyz012 3456789-.") !=
          > strlen($name)) {
          > $valid = "0";
          > }
          >
          > # Domain can only start with the following characters
          > elseif (strspn($first_ name, "abcdefghijklmn opqrstuvwxyz") < 1) {
          > $valid = "0";
          > }
          >
          > # Extension can only contain the follow characters
          > elseif (strspn($ext, "abcdefghijklmn opqrstuvwxyz") !=
          > strlen($ext)) {
          > $valid = "0";
          > }
          > else {
          > $valid = "1";
          > }
          > }
          > }
          > }
          > }
          > return $valid;
          > }
          >
          > function sendmail ($_address_file , $_email_from, $_email_from_na me,
          > $_email_subject , $_email_message , $_mime_type) {
          > $f = 0;
          > print "<script
          > type=\"text/javascript\">ma keListWindow(); startListWindow ();</script>";
          >
          > foreach ($_address_file as $key => $value) {
          > $pieces = explode(",", $value);
          > foreach ($pieces as $piece_no => $piece_value) {
          > if ($piece_no == 0) {
          > $lastname[$key] = $piece_value;
          > }
          >
          > if ($piece_no == 1) {
          > $firstname[$key] = $piece_value;
          > }
          >
          > if ($piece_no == 2) {
          > $email[$key] = $piece_value;
          > }
          > }
          > $fullname = $firstname[$key].' '.$lastname[$key];
          > if ($fullname != ' ') {
          > $to = '"'.$fullname.' " <'.$email[$key].'>';
          > }
          > else {
          > $to = $email[$key];
          > }
          > if ($_email_from_n ame != '') {
          > $from = '"'.$_email_fro m_name.'" <'.$_email_from .'>';
          > }
          > else {
          > $from = $_email_from;
          > }
          >
          > if ($_mime_type == "html") {
          > $headers = "From: $from\r\n";
          > $headers .= "MIME-Version: 1.0\r\n";
          > $boundary = md5(uniqid(rand (), true));
          > $headers .= "Content-Type: multipart/mixed" .
          > "; boundary = $boundary\r\n\r \n";
          > $headers .= "This is a MIME encoded message.\r\n\r\ n";
          > $headers .= "--$boundary\r\n" .
          > "Content-Type: text/html; charset=ISO-8859-1\r\n" .
          > "Content-Transfer-Encoding: 7bit\r\n\r\n";
          > }
          >
          > else {
          > $headers = "From: $from\r\n";
          > }
          >
          > $success = mail ($to, $_email_subject , $_email_message , $headers);
          > if ($success) {
          > $popup_address = "sent: ".$to."<br/>";
          > print "<script type=\"text/javascript\">va r popupAddress = \"<?php
          > echo $popup_address;
          > ?>\";newListWin dow.document.wr ite(popupAddres s);</script>";
          > sleep ($_emaildelay * 60);
          > }
          > else {
          > $failed[$f] = $to;
          > $f++;
          > }
          > }
          >
          > if ($failed > 0) {
          > print '<script type=\"text/javascript\">al ert (\"Failure Sending
          > Email\");</script>';
          > print "The following addresses did not send:\r\n";
          > foreach ($failed as $key => $value) {
          > print $failed[$key]."\r\n";
          > }
          > }
          > }
          >
          > if ($_POST['submit_check']) {
          > $valid = emailcheck ($email_from);
          > if (!$valid) {
          > print "<script type=\"text/javascript\">al ert('Please enter a valid
          > email address in the EMAIL FROM field');</script>";
          > }
          > else {
          > $email_message =
          > file_get_conten ts($_FILES['message_file']['tmp_name']) or
          > die($errors['cant_open_mess age']);
          > $address_file = file($_FILES['address_file']['tmp_name']) or
          > die($errors['cant_open_addr ess']);
          > sendmail ($address_file, $email_from, $email_from_nam e,
          > $email_subject, $email_message, $_POST['mime_type']);
          > }
          > showform ($email_from, $email_subject,
          > $_FILES['address_file']['name'], $_FILES['message_file']['name'],
          > $email_delay, $_POST['mime_type']);
          > }
          > else {
          > showform ($email_from, $email_subject,
          > $_FILES['address_file']['name'], $_FILES['message_file']['name'],
          > $email_delay, $_POST['mime_type']);
          > }
          > ?>
          >[/color]


          Comment

          Working...