Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2006
    Posts
    17

    Unanswered: Form that inserts into table, then emails

    if i have an email form with textboxes and textareas, is it possible to have what was entered in those textboxes/areas put into a mysql table before sending out the email? so, if i were using a PHP script, can i run INSERT statements first?

    taking a slightly different approach, is it possible to have a PHP file run the INSERT statements, then call a perl/cgi script that handles the email form? (we have a cgi script that was provided to us, but we can't modify it.)

    what we essentially want is a copy of the email that is being sent out, with the ability to view that email at a later time.

  2. #2
    Join Date
    Aug 2006
    Location
    San Francisco, CA
    Posts
    136
    I am assuming that you are coming from some sort of
    html form page and sending the info from a POST method in php

    HTML Code:
    <form action="xxx.php" method="post">
    Enter email here
    <input type = "text" name="email" />
    Enter email address here
    <input type = "text" name="emailaddress" />
    ... etc.
    <input type="submit" value="send" />
    
    </form>

    PHP Code:
    <?php      

        $email 
    $_POST["email"];      
        
    $emailaddress $_POST["emailaddress"];
    ... 
    etc.
    ?>
    Now you have the email and all the info in different variables. Now you can do whatever with it, as long as you don't loose the scope of the variable or alter their values.

Posting Permissions

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