简体   繁体   English

如何将数据输入到 <input> 表格使用PHP?

[英]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.

相关问题 如何使用与表单输入和验证相同的脚本将PHP表单输入保存在MySQL数据库中 - How do i save PHP form input in MySQL database using same script as form input and validation 如何在没有 Php 的情况下使用表单将输入发送到 url? (形式动作) - How do I send input to url using form without Php? (form action) 如何使用表单输入将表单中的数据拉入会话 - How do I pull data from a form into a session using an out of form input 如果我使用 Content-Type multipart/form-data 如何获取“php://input”数据 - How to get “php://input” data if I'm using Content-Type multipart/form-data php-如何根据用户的表单输入重定向用户? - php - How do I redirect a user based on their form input? 如何将HTML表单输入传递给PHP,然后传递给Ruby? - How do I pipe HTML form input into PHP and then to Ruby? 如何使用受控语句和html表单通过php通过php向mysql db添加一行到用户输入? - How do I add a row to mysql db via php using controlled statements and html form for user input? 如何使用ajax将文本输入字段附加到表单,而又不会丢失表单上的用户输入? - How do I append a text input field to a form using ajax without losing user input on the form? 如何使用表单输入更改URL的一部分? - How do I change part of a URL using form input? PHP &amp; MySQL:如何将用户输入与数据库中的数据进行比较? - PHP & MySQL: How do I compare the user input to data in the database?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM