steves Posted January 8, 2007 Share Posted January 8, 2007 Is it possible to have 2 different forms trying to perform an action at the same time? The first form will insert information into the database, the second form would send an email stating that new data has been entered. Will this work or am I going about it the wrong waY?<form method="post" action="insert.php"><form method="post" action="sendemail.php">Thank youSteve Quote Link to comment Share on other sites More sharing options...
weknowtheworld Posted January 8, 2007 Share Posted January 8, 2007 You have to write two forms one after the other. And submit the other form by javascript. Quote Link to comment Share on other sites More sharing options...
steves Posted January 8, 2007 Author Share Posted January 8, 2007 Currently the only form made is the one that inserts the information to the database, which works great. What javascript code should I be looking for to help me send an email with the submitted information at the same time? Quote Link to comment Share on other sites More sharing options...
fenway Posted January 8, 2007 Share Posted January 8, 2007 Or just have one PHP script do everything. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted January 9, 2007 Share Posted January 9, 2007 you can have one form with two different actions but it requires js. Quote Link to comment Share on other sites More sharing options...
fenway Posted January 9, 2007 Share Posted January 9, 2007 Again, why have 2 separate actions ever? Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted January 9, 2007 Share Posted January 9, 2007 I used one in a cms - one form 2 jobs - action one was to a script to show a preview of what page would look like and action 2 was to commit to the database. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted January 9, 2007 Share Posted January 9, 2007 [quote author=ToonMariner link=topic=121539.msg500568#msg500568 date=1168347669]I used one in a cms - one form 2 jobs - action one was to a script to show a preview of what page would look like and action 2 was to commit to the database.[/quote]That's not what he wants. He wants it to be able to have to actions simultaneously (that is at least how I read it). Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted January 9, 2007 Share Posted January 9, 2007 Sorry didn't read his initial post (being lazy - unlike me ;) ) and yes yo0u are correct you don't need two actions for that - the script thatprocesses teh data can query the database for insert/update and then send out the e-mail - no need for two actions. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.