Strawberry
Strawberry

Reputation: 67868

How do I input data into <input> form using PHP?

Okay, basically, I have a large list of phone numbers in a text file and I need to submit them all into a website by copy and pasting the phone number into the input form on the website and hit submit. Now, how can I automate this using PHP? I have no access to the website with input form.

Upvotes: 1

Views: 265

Answers (3)

Andy Lester
Andy Lester

Reputation: 93636

If you're not tied to PHP, and can use Perl, use WWW::Mechanize.

http://search.cpan.org/dist/WWW-Mechanize/

Upvotes: 1

Mike B
Mike B

Reputation: 32145

If the phone numbers are stored 1 per line in the file, you can use file() to open it and you'll have an array of phone numbers.

If they are stored some other way, you can use file_get_contents() and explode() the numbers into an array.

Loop over the array and use cURL to post the numbers to the website.

Upvotes: 3

Adam Taylor
Adam Taylor

Reputation: 7783

Loop through the text file and use Curl to fill in / submit the form?

http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html

Sorry I'm not really a PHP coder...

Upvotes: 1

Related Questions