Jump to content

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


saversites

Recommended Posts

Folks,

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

Edited by saversites
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...