我试图建立一个脚本,使工作更容易。我是PHP的新手,所以请原谅我。我希望有人能帮助我。
基本上我有简单的html dom解析器,我需要它做的是添加一个单词/s到url字符串的结尾。
这是我目前所拥有的:
<?php
include_once('simple_html_dom.php');
$SNBS_URL = "http://www.facebook.com/". $clientid
$clientid = $_GET["clientid"];
// Create DOM from URL or file
$html = file_get_html($SNBS_URL);
// find all div tags with id=gbar
foreach($html->find('div#foot') as $e)
echo $e->innertext . '<br>';
?>
<form id="form1" name="form1" method="post" action="extract_html.php">
Client ID
<input name="clientid" type="text" id="clientid" value="enter id" />
</label>
<input type="submit" name="submit" id="submit" value="Submit" />
</form>
我已经使用facebook url作为测试。我需要表单提交字符串到url的末尾,并获得html dom解析器来解析最终url:
www.facebook.com/+表单提交关键字
因此,一旦在网页上按下提交按钮,html dom解析器将解析www.facebook.com/keyword.entered。
我很抱歉,如果我很难理解,任何帮助将非常感激。
谢谢
$SNBS_URL = "http://www.facebook.com/". $clientid
$clientid = $_GET["clientid"];
应:$clientid = $_GET["clientid"];
$SNBS_URL = "http://www.facebook.com/". $clientid