1

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.

3
  • You want to know how to...generate the form? Or how to access the data submitted in/by the form? I'm sorry, but I don't understand what 'list' you're referring to. If you can clarify your question I'll try and be helpful, though =) Commented Oct 21, 2009 at 23:18
  • Please elaborate. what is your list? Is it local or server generated? Where are you submitting the form? Commented Oct 21, 2009 at 23:19
  • Maybe you should try unit testing. Commented Oct 21, 2009 at 23:20

3 Answers 3

3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

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...

Comments

1

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

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

1 Comment

Yeah, but this doesn't answer the question. He asked specifically about how to do this with PHP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.