Php auto submit form

Discussion in 'PHP' started by Om ji Kesharwani, Aug 18, 2010.

  1. #1
    how to auto submit the form in 2 hours.
     
    Om ji Kesharwani, Aug 18, 2010 IP
  2. vinoth.t

    vinoth.t Peon

    Messages:
    156
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just create javascript function to submit a form and use timer function too
     
    vinoth.t, Aug 19, 2010 IP
  3. Om ji Kesharwani

    Om ji Kesharwani Peon

    Messages:
    211
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I know to use timer but tell me how can i allow submit button to submit the data by using javascript in specific time.
     
    Om ji Kesharwani, Aug 19, 2010 IP
  4. MyVodaFone

    MyVodaFone Well-Known Member

    Messages:
    1,048
    Likes Received:
    42
    Best Answers:
    10
    Trophy Points:
    195
    #4
    Will auto submit the form at the allotted time in seconds, see below.
    
    </head>
    <body>
    <form name="myform" method="get">
    <p><input type="text" size="8" name="start"  /></p>
    </form>
    
    <script type="text/javascript">
    function myfunc () {
    var frm = document.getElementById("myform"); // myform is the name of your form
    frm.submit();
    }
    window.setInterval ("myfunc()", 60000); // equals 60 seconds so two hours must be 7200000 ?
    </script>
    
    PHP:
     
    MyVodaFone, Aug 19, 2010 IP
  5. GeekOnline

    GeekOnline Peon

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    try Cron jobs! much more easy and confirmed submit
     
    GeekOnline, Aug 22, 2010 IP
  6. Googl

    Googl Active Member

    Messages:
    509
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    75
    #6
    From the server you mean?
     
    Googl, Aug 22, 2010 IP
  7. GeekOnline

    GeekOnline Peon

    Messages:
    58
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes! make sure that the form submits

    test it once or twice

    then setup the cron job
     
    GeekOnline, Aug 22, 2010 IP
  8. Om ji Kesharwani

    Om ji Kesharwani Peon

    Messages:
    211
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks to all. I have done it through javascript is there any drawback?
     
    Om ji Kesharwani, Aug 24, 2010 IP
  9. Rainulf

    Rainulf Active Member

    Messages:
    373
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    85
    #9
    It's best to do it in cron. But if you're just going to use it for personal reason, then there should be no problem doing it in js. One drawback I could think of is that you have to keep your browser and computer on.. lol
     
    Rainulf, Aug 24, 2010 IP
  10. Cyb3rgh0st_

    Cyb3rgh0st_ Greenhorn

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #10
    cron is bet way todo this :p !
     
    Cyb3rgh0st_, Aug 26, 2010 IP
  11. efikra

    efikra Guest

    Messages:
    89
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    pls search to google
     
    efikra, Aug 26, 2010 IP