Session EMAIL

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

    Session EMAIL

    i have a multipage application. The Variables are stored in sessions
    which then are generated to show the user the results from there i
    would like the user to his submit and it be emailed back to me....how
    would i make that happen?

    here is how i have my sessions stored
    <?
    session_start() ;
    header("Cache-control: private");
    $_SESSION['Page_7'] = $_POST;
    ?>

    and how they are displayed:

    <?
    ksort($_SESSION );
    foreach ($_SESSION as $page=>$_POST)
    {
    echo "<div class=\"h3\">$p age</div><br>";
    foreach ($_POST as $field=>$value)
    {
    echo "$field: $value<br>";
    }
    }
    ?>

  • lig

    #2
    Re: Session EMAIL

    So what is the problem? the email part or the dispaly part? if it is
    the email - have you looked at mail()?

    Comment

    • Quinonez

      #3
      Re: Session EMAIL

      the email part is my question....... . i know how to set up mail() just
      not how i would call from the $_SESSION variables

      Comment

      • mark

        #4
        Re: Session EMAIL

        To include the values of $_SESSION in the email message would be
        similar to your code for displaying the values, except instead of
        echoing each one, you'd add it to a string, then send that string as
        the email message.

        Something like:

        <?
        ksort($_SESSION );
        $message = "";
        foreach ($_SESSION as $page=>$_POST) {
        $message .= "Page: $page\n\n";
        foreach ($_POST as $field=>$value) {
        $message .= "$field: $value\n";
        }
        }

        mail("yourself@ yourdomain.com" , "Session Info", $message);
        ?>

        Hope that helps.

        Mark

        Comment

        Working...