1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Form submit multiple times

Discussion in 'PHP & Perl' started by rudeboi, Jun 21, 2009.

  1. rudeboi

    rudeboi Newbie

    Joined:
    Nov 8, 2008
    Messages:
    28
    Likes Received:
    34
    Occupation:
    Internet Mandem
    Location:
    Jolly old England
    Hello guys,

    I have a php online form that also uses java. When you click submit it sends away all the inputted information from the page.

    I would like to know how I can make it submit this information again and again and again when the submit button is pressed.

    As many times a second as possible, the more the better.

    As a follow on from that maybe I can add a selection for how many times and how long I want the form to submit for.

    For example:

    Submit form 50 times a second for 20 minutes when submit button is pressed!
     
  2. mydodo

    mydodo Newbie

    Joined:
    Jan 14, 2009
    Messages:
    39
    Likes Received:
    5
    use ajax
     
  3. zackster

    zackster Registered Member

    Joined:
    Jan 9, 2009
    Messages:
    66
    Likes Received:
    33
    It's gona be tricky but AJAX or Javascript should be able to do it but not very quietly...
     
  4. insider

    insider Regular Member

    Joined:
    Jul 5, 2009
    Messages:
    344
    Likes Received:
    134
    Location:
    Europe
    JS

    Code:
    var sendThatForm = function(){
        document.getElementById('myFormId').submit();
        setTimeout(sendThatForm,20);
    };
    
    and in you html add onsubmit to the form

    Code:
    <form onsubmit="sendThatForm(); return false;">
     
  5. clabers

    clabers Newbie

    Joined:
    Dec 28, 2013
    Messages:
    45
    Likes Received:
    4
    Home Page:
    pm me detail i will take a look
     
  6. Schvamp

    Schvamp Power Member

    Joined:
    Feb 13, 2012
    Messages:
    684
    Likes Received:
    549
    Location:
    Hogwarts
    Should be an easy task to archive
    Just modify the file your visitors are sent to on submit, and have it loop a few extra times.

    Can't give you any 100% working solution without the source code tho :)
    Code:
    <form name="htmlform" method="post" action="loop.php">
     
  7. barigain

    barigain Junior Member

    Joined:
    Aug 23, 2012
    Messages:
    100
    Likes Received:
    12
    You forgot about target - when form is submited first time, your JS script is stopped.
    So use the following target:
    Code:
    <form name="htmlform" method="post" action="loop.php" target="page2">
     
  8. Schvamp

    Schvamp Power Member

    Joined:
    Feb 13, 2012
    Messages:
    684
    Likes Received:
    549
    Location:
    Hogwarts
    Oh, my quoted code was just as an example. I'm not sure why you would like to use JS at all TBH.
    I meant that the loop can be created in PHP at the page that handles the action.
     
  9. vict0r

    vict0r Newbie

    Joined:
    Sep 18, 2013
    Messages:
    43
    Likes Received:
    4
    With PHP you can make a CURL to send the information... It'll use less time.
     
  10. vagheladev

    vagheladev Newbie

    Joined:
    Jan 4, 2014
    Messages:
    8
    Likes Received:
    0
    Occupation:
    Business Development
    Location:
    Banglore
    Hello

    Please user for loop .

    in this for loop you have to enter value multiple time. if not add then you then user for loop in ajax. both are working.

    Regad
    Vaghela Dev