내 시나리오에는입니다 . 여기 문제는
if(isset($_POST['check_url']))
{
$client_url = $_POST['client_url'];
$destination_url = $_POST['destination_url'];
$contents = file_get_contents($destination_url);
$search = $client_url;
if(strpos($contents,$search)== FALSE)
{
echo "Not Found";
}
else
{
echo "Found";
}
}
내 HTML 스크립트입니다 : 여기
내 PHP 스크립트입니다 위의 스크립트는 하나의 대상 URL의 경우 작동되지만
<form method="post" action="test.php">
<label>Client URL:</label>
<input type="text" value="" name="client_url" /><br />
<label>Destination URL:</label>
<textarea value="" name="destination_url" ></textarea><br />
<button type="submit" name="check_url">Check</button>
</form>
여러 개의 대상 URL을 게시하려고 할 때 (배열로 변환하여) 오류가 발생했습니다 :
Warning: file_get_contents(http://learntk12.org/story.php?title=seo-link-building-service) [function.file-get-contents]: failed to open stream: No such file or directory in "path to source file" on line 24
여기서 24 행은 :입니다.
if(isset($_POST['check_url']))
{
$client_url = $_POST['client_url'];
$destination_url = $_POST['destination_url'];
$destination =str_replace("\r",",",$destination_url);
$arr = explode(",",$destination);
$search = $client_url;
for($i=0;$i<count($arr);$i++)
{
$contents[$i] = file_get_contents($arr[$i]);
if (strpos($contents[$i], $search) === FALSE)
{
echo "Not Found";
}
else
{
echo "Found";
}
}
}
나는이 스크립트에 떨어지고 오전 : 여기
배열 내 PHP 코드?
첫 번째 codelisting은 타의 추종을 불허하는 폐쇄가'}' – Ikke
덕분에 난 그냥 – Arish