One form, one button, multiple actions

I have a form. When the user clicks “Submit,” I need the form posted to one URL, and email sent to an administrator, and the user’s browser redirected to a confirmation page. I have no idea how to do this. is PHP or javascript best?

The best is to use PHP.

JavaScript aint going to be able to send emails, so PHP is your tool.

Something like this:

if(isset($_POST['my_button'])) {
  mail('', 'Form Submitted', "Hello Admin.\\r\
Your form was submitted");


<form method="post" action="my_script.php">
<input type="submit" name="my_button" value="Submit">

thank you. I’ll try.