[英]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? 现在,如何使用PHP自动执行此操作? I have no access to the website with input form. 我无法使用输入表单访问网站。
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. 如果电话号码在文件中每行存储1个,则可以使用file()
将其打开,然后会有一系列电话号码。
If they are stored some other way, you can use file_get_contents()
and explode()
the numbers into an array. 如果以其他方式存储它们,则可以使用file_get_contents()
并将explode()
分解为数组。
Loop over the array and use cURL to post the numbers to the website. 遍历数组,然后使用cURL将数字发布到网站。
Loop through the text file and use Curl to fill in / submit the form? 循环浏览文本文件并使用Curl填写/提交表单?
http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html http://www.askapache.com/htaccess/sending-post-form-data-with-php-curl.html
Sorry I'm not really a PHP coder... 抱歉,我不是真正的PHP程序员...
If you're not tied to PHP, and can use Perl, use WWW::Mechanize. 如果您不依赖PHP,并且可以使用Perl,请使用WWW :: Mechanize。
http://search.cpan.org/dist/WWW-Mechanize/ http://search.cpan.org/dist/WWW-Mechanize/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.