Is it possable for an HTML form to have more than 1 action?
I need it to forward to another page, and to sent an e-mail with form data.

<form name="products" enctype="text/plain" method="post" action="mailto:me@mymail.co.za?subject=My Subject? page2.php">

This method doesn't work.
Any suggestions?

    You cannot have form with more than one action BUT you can have your form handler to have more than one purpose...

    For instance my form handlers do three things:
    1. enter data to a database after checking it (is a data is not like it is supposed to be I redirect to a form and inform a user of a problem)
    2. send emails to a user filling the form and the client
    3. redirect either to the Thank you page or Sorry page if there was a error

    Does this answer you question?

      thank you very much. I have never used form handlers.
      Would that look something like this? :

      <?php
      $to="Recipient Name <me@mymail.com>";
      $from="Sender Name <customer@hismail.com>";
      $subject="My first HTML E-mail";
      $message="<h1>HTML E-mail</h1>
      <p>This is an <b>HTML</b> e-mail.</p>";
      ?>

      But this still doesn't take the form data to another page, where I will have another form saving to a DataBase.

      My project is a form where a customer can select multiple quantities from products.
      I need that form to mail to me, and go on to the next page, where cust fills in his detail,
      and that saved to mySQL table.

      Once again, thanks for your time.

        I'll give you an example and you work from there:

        //in a form you have a field named email that stores client's email address
        //so in form handler page you can do the following:
        if(isset($_POST['email'])){
             //do whatever checks you do to verify the address
             //now make form input safe for your database
             $email = htmlspecialchars($_POST['email']);
             $email = stripslashes($email);
             $email = mysql_real_escape_string($email);
        
         //create a query
         $query = "INSERT INTO $TABLE SET email = '$email'";
         $result = mysql_query($query);//asuming that you have opened a db connection
        
         if(mail($email,"Thank you","Thank you, man!") && mail($your_email,"Order!","There has been an order!")){//send a thank you mail to this user and receive an order in you mailbox
              header("Location:path/to/thank/you/page.php");//redirect to a thank you page because mails have been sent
         }
         else{
              header("Location:path/to/sorry/page.php");//redirect to a sorry page because the mails weren't sent
         }
        }
        

        In this case even if a user gets a sorry page his details will be entered into the database...

          Thanks man, sure I'll be able to use that in future.
          But there should be a simpler way for what I want to do.
          I have basicly have a html form that once I submit, goes another page,
          where it shows products chosen, and where buyer needs to put in his detail.
          Customer detail gets saved to a customer able in mySql.
          I don't need the HTML data stored, just mailed from the first html form.

          The Submit action can either post to php page, or mailto e-mail.
          Not both.
          Without having to change the html form to a dinamical php form, how can get this data mailed, and posted to another page?

          Sorry for my newbieness, maybe I just used bad practise from the start?

          <form name="products" method="post" action=" addcust.php? mailto:my@mye-mail.co.za?subject=purchase">

            No in your action ="some.php" you would just go through the steps as was shown in the example code above (you would have an email field in the form) that code first looks to see if the email field was set if so it then gives a small code to send to the user, of course you could make it more extravagent, then the code inserts the users email into your data base if the email was not filled out the header sends the user to another page to do whatever you want to do when a user doesn't fill out the email field.

            The PHP page that processes your page can do whatever you set it to do upon submission. It is up to you to decide what it is that you want to happen and then code the page to handle it.

              awsome
              Think I understand the point now.
              Let me go try it out a little.
              The only thing is, that I don't the visitor to recieve the mail, it should come to me, or a set adress.

              But thanks very much, open source really rocks.

                Most likely you would want to have the email to be sent to you, unless you send two emails. One would be a little welcome e-mail to the user thanking them for their time and all that stuff, and the other would let you know that you recieved so many new signups or visits or whatever to your site, plus verisy that you script is actually working.

                  Write a Reply...