save to db and email to user

Discussion in 'PHP' started by selfAfflicted, Aug 28, 2008.

  1. #1
    Is there a way for a form to both be saved and emailed out when submitted?

    right now I have
    <form id="webeoc" name="webeoc" method="POST" action="<?php echo $editFormAction; ?>">

    where
    action="<?php echo $editFormAction; ?>"

    saves it in the db, but I am unsure how I would get a mailto: script in there as well, any ideas?
     
    selfAfflicted, Aug 28, 2008 IP
  2. Joseph S

    Joseph S Well-Known Member

    Messages:
    1,373
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    155
    #2
    PHP, and set up the add&email in $editFormAction.
     
    Joseph S, Aug 28, 2008 IP
  3. selfAfflicted

    selfAfflicted Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Do you know the code for add&email, if so then I can put it in the $editFormAction function. If not, I am unsure of what I'll end up doing.
     
    selfAfflicted, Aug 28, 2008 IP
  4. softvision

    softvision Peon

    Messages:
    146
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    you can search for email code on Google or yahoo.
     
    softvision, Aug 28, 2008 IP
  5. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #5
    use the mail function in php

    if the form is submitted

    <php>
    $to = $_POST['email'];
    $from = ...
    $headers = ..
    $body = ....

    if(mail($to,$from,$headers,$body))
    {
    insert into database....
    }
    </php>

    just like that
     
    bartolay13, Aug 28, 2008 IP
  6. selfAfflicted

    selfAfflicted Peon

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I guess its not as intuitive as I thought it would be, hopefully I'll figure out the correct way to finish up this project. Thanks for everyones help, my not understanding doesn't have anything to do with yall not answering my question.
     
    selfAfflicted, Sep 2, 2008 IP