Filling forms using javascript

Discussion in 'JavaScript' started by cycyber, Jun 15, 2007.

  1. #1
    I can automatically fill forms on the page with HTML DOM code, but is it possible to fill forms on pages that you're being redirected to?

    Like, a user clicks a submit button on your page, and it redirects you to some other domain that you don't own/have any association with, is it possible for the javascript on the 1st page to be on a timer or something to autofill out a textbox on the 2nd page that the user just got send to via your redirect button.

    I'm trying to figure out how proxy.org/goodwaiter.com autofill forms on other pages then submit the form on that other page to show the user results.
    I know they use perl and cgi, but anyone know of code on how it works, google isn't being too helpful tonight. Even perl/cgi code would be fine.
     
    cycyber, Jun 15, 2007 IP
  2. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #2
    The way that proxy.org submits forms on other sites is by using cURL or other methods. The autofilling forms on "other" sites is done by first getting the HTML of the remote page and then showing it on their server.
     
    krt, Jun 15, 2007 IP
  3. cycyber

    cycyber Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Another question for ya, instead of submitting the 2nd form wich is a 3rd party form anyway, is there a way to fill it out and leave it unsubmitted, so the user will have to click submit a 2nd time?

    Ex: Person clicks submit on my page >> sends them to 3rd party site and fills in a name or something in a txtfield on a 2nd page, before the user clicks submit again.

    Can curl be used for that, cause I didn't see anything like that in the documentation?
     
    cycyber, Jun 18, 2007 IP
  4. krt

    krt Well-Known Member

    Messages:
    829
    Likes Received:
    38
    Best Answers:
    0
    Trophy Points:
    120
    #4
    You use cURL to get the HTML from the page with the form on it.
    Save the HTML to a variable or something.

    Then use regex to find the input fields in the HTML and hard code new values into it. Then output the modified HTML.
     
    krt, Jun 18, 2007 IP
  5. cycyber

    cycyber Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Wow krt, you know your stuff. Thanks alot
     
    cycyber, Jun 19, 2007 IP