posting form data to two php scripts at once

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • one.1more@gmail.com

    #1

    posting form data to two php scripts at once

    How do i post the form data to different php files at once. I tried the
    following code but it doesn't work. the data is sent only to the first
    php file.

    <form method="post" action="insert. php" action="mail.ph p">
    Email<input type="text" name="email" value ="" size="20" />
    <input type="submit" value="submit" />
    </form>


    Is there a solution?

  • Andy Hassall

    #2
    Re: posting form data to two php scripts at once

    On 16 Dec 2006 17:08:45 -0800, one.1more@gmail .com wrote:
    >How do i post the form data to different php files at once. I tried the
    >following code but it doesn't work. the data is sent only to the first
    >php file.
    >
    <form method="post" action="insert. php" action="mail.ph p">
    >Email<input type="text" name="email" value ="" size="20" />
    ><input type="submit" value="submit" />
    ></form>
    You can't, HTML forms don't work like that.

    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    • one.1more@gmail.com

      #3
      Re: posting form data to two php scripts at once


      Andy Hassall wrote:
      On 16 Dec 2006 17:08:45 -0800, one.1more@gmail .com wrote:
      >
      How do i post the form data to different php files at once. I tried the
      following code but it doesn't work. the data is sent only to the first
      php file.

      <form method="post" action="insert. php" action="mail.ph p">
      Email<input type="text" name="email" value ="" size="20" />
      <input type="submit" value="submit" />
      </form>
      >
      You can't, HTML forms don't work like that.
      >
      --
      Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

      I have slightest idea, but i dont know how to finish this.i opened
      mail.php
      and added following at the end:
      require_once insert.php;
      $pass_on_again = ******* ($email);

      what do i replace the ******* with?

      Comment

      • seaside

        #4
        Re: posting form data to two php scripts at once


        one.1more@gmail .com schrieb:
        How do i post the form data to different php files at once. I tried the
        following code but it doesn't work. the data is sent only to the first
        php file.
        >
        <form method="post" action="insert. php" action="mail.ph p">
        Email<input type="text" name="email" value ="" size="20" />
        <input type="submit" value="submit" />
        </form>
        You simply can't submit two forms at once.

        I'd propose to use AJAX's XMLHttpRequest. As a starting point, look
        here: http://de.wikipedia.org/wiki/XMLHttpRequest

        Basically, you need to instantiate two XMLHttpRequest object, and fire
        them one after the other. Both XMLHttpRequest get fired asynchronously,
        if used using correct settings.

        To prepare the XMLHttpRequest, use JavaScript

        Comment

        Working...