dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Two Actions With One Submit

  1. #1
    Join Date
    Sep 2010
    Posts
    36

    Exclamation Two Actions With One Submit

    Hi there,

    I have a form which people use to place orders on my website. At the moment when they submit it sends the info to my email address is the usual way.

    I now have a php file that submits the info to a MySQL database.

    What I would like to do is when the user clicks submit, it sends the info to my email address AND runs the php that updates my database.

    I can only make the submit button do one or the other.

    Thank you in advance for any and all help.

    Kind regards

    Mike

  2. #2
    Join Date
    Sep 2010
    Posts
    43
    Just adding a mail function to the PHP file would do the trick.

    The data should already be processed in preparation to be inserted into the database.

  3. #3
    Join Date
    Sep 2010
    Posts
    36
    Thank you for your swift response.

    I made a mistake in my post. I currently use an autoresponse php which sends me the form data and send sthe user an auto reply.

    Is there a way of joining the autoresponse php with the MySQL php?

    I have tried just adding it to the bottom of the autoresponse php file, but it adds a blank record to my database everytime the page loads!

    Thanks again, any help much appriciated!

    Kind regards

    Mike

  4. #4
    Join Date
    Sep 2010
    Posts
    10
    I would probably insert the data into the database at the start of the autoresponse script, and after inserting into the database don't end the script or redirect just let it continue to process the send mail..

  5. #5
    Join Date
    Oct 2010
    Posts
    1
    How about posting to a third script which includes one and two?

    <?php
    include ('sendmail.php');
    include ('database.php');
    ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles