我是初学者,我想知道我们是否可以用PHP编写代码,通过它我们可以在任何网站的搜索框中输入关键字并提交。
所以这个 php 函数会有 2 个输入:
function enter_keyword($website_url, $keyword)
{
}
function enter_keyword($website_url, $keyword) { }
会有很大的帮助 提前致谢
最佳答案
您需要提供要在其中使用此功能的每个网站的搜索页面的 URL,并且还必须提供包含关键字的文本字段的名称。例如,在;
<form method='post' action='http://site.com/search.php'>
<input type='text' name='keyword'>
网址为“http://site.com/search.php” ' 字段的名称是 'keyword'。
然后,使用 CURL在 PHP 库中,您可以向该 url 发出 GET 或 POST 请求。
关于php - 使用php脚本在任何网站的搜索框中输入关键字,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/716772/