텍스트 영역에 입력 한 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' 여야합니다. –
PHP를 처음 사용하는 경우라도 "작동하지 않는 것"이상을 알고있을 것입니다. 귀하의 질문에 약간의 노력을 기울이십시오. –
의견을 주셔서 감사합니다. 정말 다른 것을 알지 못 했으므로 오류가 보이지 않았습니다 ... – RuFFCuT