Jump to content
Killersites Community
Sign in to follow this  
saversites

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

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

Share this post


Link to post
Share on other sites

Why not just the form information and submit the form and use PHP's form processing superglobals (PHP superglobals $_GET and $_POST) to parse the form input fields?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×