我想获取在文本区域输入的URL的元标记,这是什么问题?PHP获取元标记,URL中的数组= =不工作
此外,我将如何把元描述来自描述的URL?
<form method="get">
<textarea name="TAData">
</textarea>
<input type="submit" value="submit"/>
</form>
<div id="checkboxes">
<input type="checkbox" name="vehicle" value="PR" /> Show me the PR<br />
<input type="checkbox" name="vehicle" value="KW Tag" /> Show me the KW tag<br />
<input type="checkbox" name="vehicle" value="Title Tag" /> Show me the Title tag<br />
</div>
<div id="checkboxes">
<input type="checkbox" name="vehicle" value="1stH1" /> Show me the 1st H1<br />
<input type="checkbox" name="vehicle" value="2ndH1" /> Show me the 2nd H1 tag<br />
<input type="checkbox" name="vehicle" value="SeedKW" /> Show me Seed KW's<br />
</div>
<div id="nofloat"></div>
<?php
//make the array
$TAarray = explode("\n", strip_tags($_POST['TAData']));
var_dump($TAarray);
//loop through the array
foreach ($TAarray as $line) {
$line = htmlspecialchars(trim($line));
}
foreach ($TAarray as $url) {
// get the meta data for each url
$tags = get_meta_tags($url);
unset($tags["content-type"]);
unset($tags["page-type"]);
unset($tags["page-topic"]);
unset($tags["audience"]);
echo '<tr>';
foreach ($tags['description'] as $meta)
{
echo '<td>' . $meta . '</td>';
}
echo '</tr>';
}
?>
此外,有没有办法只包括元描述?
你检查'$ _ POST [ 'TAData']'但你的表单方法是'get'。应该是'post'。 – 2012-04-10 16:20:13
即使你是PHP的新手,你可能知道的不仅仅是“不工作”。请在你的问题上付出一些努力。 – 2012-04-10 16:21:01
感谢您的意见,我真的不知道任何其他事情,然后不工作,它显示没有错误... – RuFFCuT 2012-04-10 16:24:34