Submit To Multiple Actions

Discussion in 'PHP' started by whirlybird20, May 29, 2008.

  1. #1
    Hi,

    Does anyone know of a way that I can make a php action that receives the data submitted by a form, and then re-posts it to several other actions in the background?

    I have used a script that posted the form in the background before, but I can't work out how to customize it to work how I need it to.

    This is the script

    function updateOrder(){
    var options = {
    method : 'post',
    parameters : Sortable.serialize('item_list')
    };
    new Ajax.Request('server_items_reorder.php', options);
    }

    It is part of a tutorial on reordering a database. You can find the tutorial here. http://www.wiseguysonly.com/2008/03/11/drag-and-drop-reordering-of-database-fields-with-scriptaculous/

    Thanks for you help.

    Joel
     
    whirlybird20, May 29, 2008 IP
  2. whirlybird20

    whirlybird20 Guest

    Messages:
    462
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It is alright! I solved it!

    What I did is I made the action load an I frame to the form the I want it to submit the content to.

    <iframe src="http://www.1stclasswebsites.com/contact.php" width="200" height="200" id="iframe" name="iframe"></iframe>

    Then I ran a script that filled in the form, and sent it off.
    <?
    $name = $_POST['name'];
    $email = $_POST['email'];
    $phone = $_POST['phone'];
    $message = $_POST['message'];
    ?>
    <script type="text/javascript">
    //<![CDATA[
    function fill() {
    document.iframe.contact.name.value="<?echo $name?>"
    document.iframe.contact.email.value="<?echo $email?>"
    document.iframe.contact.phone.value="<?echo $phone?>"
    document.iframe.contact.message.value="<?echo $message?>"
    document.iframe.contact.submit()
    return true;
    } // End of fill
    //]]>
    </script>
    <script>
    document.location="thankyou.php"
    </script>
     
    whirlybird20, May 29, 2008 IP