Jump to content



Photo

Need To Auto Fill-In External Website's Html Form And Submit

php bot curl form login register

  • Please log in to reply
No replies to this topic

#1 bangali_beta

bangali_beta

    Advanced Member

  • Members
  • PipPipPip
  • 133 posts
  • OS:Windows 10
  • Total Memory:4Gb
  • Framework:v4.5+, unsure
  • License:Professional Edition

Posted 09 February 2019 - 04:09 PM

Folks,

 

I am trying to build a web bot with php and/or curl that auto fills-in html forms. If you know php or cURL then kindly respond.

 

I need to auto submit urls one by one to my mysql db via my "Link Submission" form.
The Link Submission form will belong to my future searchengine which I am currently coding with php for my php learning assignment.
For simplicity's sake, let's forget my searchengine project and let's assume I have a web form on an external website and I need it filled with peoples' personal details. Say, the external website form looks like this:


    <form name = "login_form" method = "post" action="yourdomain.com/form.php" enctype = 
    "multipart/form-data"> 
    <fieldset>
    <legend>Log In</legend>
    <label>First Name: <input type="text"></label>
    <label>Surname: <input type="text"></label>        
    <input type="radio" name="sex" id="male">
    <label for="male">Male</label>
    <input type="radio" name="sex" id="female">
    <label for="female">Female</label>        
    <input type="checkbox" name="programming_laguages" 
    id="programming_laguages">
    <label for="php">Php</label>
    <input type="php" name="php" id="php">
    <label for="python">Python</label>
    <input type="python" name="python" id="python">
    <label for="country">Country:</label>
    <select name="country" id="country">
    <option value="usa">USA</option>
    <option value="uk">UK</option>
    </select>    
    <label for="address">Address:</label>
    <textarea rows="3" cols="30" name="comment" id="comment"></textarea>
    <label for="file-select">Upload:</label>
    <input type="file" name="upload" id="file-select">    
    <input type="submit" value="Submit">
    <input type="reset" value="Reset">    
    <input type="submit" value="Submit">
    </fieldset>
    </form>

As you can see, the form has the following input fields: text, radio button, checkbox, dropdown, textarea, rest button and submit button.

Now imagine I have peoples' personal details listed on an array like this:

        $first_name = array("Jack", "Jane");
        $surname = array("Smith", "Mills");
        $gender = array("Male", "Female");
        $programming_languages = array("Php", "Php");
        $country = array("USA", "USA");
        $address = array("101 Piper St, New Jersey, USA", "52 Alton Beech 
        Rd, 
        Califorinia, USA");
        $files_and_paths = array("C:\\Desktop\address.txt", "C:\\My 
        Documents\address.doc");

Now, I need the php script to grab all the data from the array and submit them one by one on the form input fields and submit the form.
In our example, the array has 2 values each and so the first person;s (eg. Jack) details must be submitted first on the first round and on the second round submit the female's (Jane) details.

I do not know how to achieve my purpose and so kindly advise with php sample codes.

I need to learn: 

1. Which php and cURL functions type into text input fields;
2. Which php and cURL functions select radio button options matching with the then array value;
3. Which php and cURL functions select checkbox options matching with the then array value;
4. Which php and cURL functions select dropdown options matching with the then array value;
5. Which php and cURL functions click buttons (reset, submit, file upload);
6. Which php and cURL functions auto upload file matching with the file name found in the file path that is listed in the then array value.

I would appreciate any snippets of codes samples or better a code sample that teaches me how to do all this.
I found no proper tutorial covering all these TASKS I mentioned. I need immediate attention.

 

Thanks







Also tagged with one or more of these keywords: php, bot, curl, form, login, register

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users