Automatic fill of web forms

Discussion in 'JavaScript' started by patrutclaudiu, Feb 9, 2006.

  1. #1
    Hello everybody

    First you should know that I'm from Romania so my english might not be so good. My problem is that I want to fill and submit from my website a form from another site. Can that be done with php or javascript? I know that it can be done with C++ but I'm not very good at that :) .
    Thanks
     
    patrutclaudiu, Feb 9, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you create a form on your site and change the action attribute to the url of the site you want to post to then this may work. Basically you duplicate the form on your site and post the data to the same script they use to process the form.
     
    mad4, Feb 12, 2006 IP
  3. seolion

    seolion Active Member

    Messages:
    1,495
    Likes Received:
    97
    Best Answers:
    0
    Trophy Points:
    90
    #3
    <form name='form2' method='post' action='http://action-path-2/'>
    <input type='hidden' name='name' value='$name'>
    <input type='hidden' name='email' value='$email'>
    </form>
    <script language='JavaScript' type='text/JavaScript'>
    document.form2.submit();
    </script>


    Something like this I have used with php/ javascript combination. values passed to one PHP file is then submitted to other action path automatically.
     
    seolion, Feb 28, 2006 IP
  4. Jowan Pasco

    Jowan Pasco Peon

    Messages:
    38
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can just do a "GET" request to the right url. For instance, if the form you want to submit looks like this:

    <form method="post" action="http:/url.com/submit">
    <input type=text name=username>
    <input type=text name=email>
    <input type=submit>
    </form>

    Then to submit this directly all you do go to a url like this:

    http:/url.com/submit?name=this%20is%20a%20name&email=me@me.com

    In javascript you can just do location.href=<url above>

    URLs are broken since I can't post URLs yet.
     
    Jowan Pasco, Mar 2, 2006 IP
  5. shenfo

    shenfo Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I am trying to populate a HTML form from the URL. Can you take a look at this and let me know where i am going wrong. The results will be sent via email to me. Whena user fills out the form.

    Here is my code :
    <form method="GET" action="submit.htm">
    <input type=text name=username>
    <input type=text name=email>
    <input type=submit>
    </form>

    URL: http://dizam.org/Work.htm?name=David

    Any assitance is appreciated.
     
    shenfo, Mar 18, 2006 IP
  6. fluid

    fluid Active Member

    Messages:
    679
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    70
    #6
    1. <form method="GET" action="submit.htm"> will send the form to submit.htm and you're requesting the variables in Work.htm

    2. <input type=text name=username>, <input type=text name=email> declares two input fields with names 'username' and 'email'

    3. URL: dizam.org/Work.htm?name=David is expecting a querystring name as opposed to username and email ?

    4. Rename Work.htm to Work.php
     
    fluid, Mar 26, 2006 IP
  7. shenfo

    shenfo Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I did what your suggested. However, what i want to do is send the variables as a link in an email to someone and have it autopopulate.

    Any ideas??
     
    shenfo, Mar 27, 2006 IP
  8. Vader_S

    Vader_S Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Hello everybody

    Well, I just wanted to ask how can I create -if it a way exists of course- a perl program that can fill automatically php post web forms. I would really appreciatte your help.

    Thanks
    Sakti
     
    Vader_S, Aug 1, 2007 IP