Im trying to find if a word exists on the page and the pages title in multiple pages My code is
<form method="post">
<label for="adres">Adres</label><br /><textarea id="adres" name="adres"></textarea><br />
<input type="submit" value="Generate" />
</form>
<?php
if ($_POST){
$adres = $_POST['adres'];
function getTitle($Url){
$str = file_get_contents($Url);
if(strlen($str)>0){
preg_match("/\<title\>(.*)\<\/title\>/",$str,$title);
return $title[1];
}
}
$name = getTitle("$adres");
function check_url($url) {
$page = file_get_contents($url);
$code = 'alt="mh"';
if (strpos($page, $code) == TRUE) {
$soft = '[img]http://www.ufs.pl/forum/images/icons/icon3.png[/img]';
echo "$soft";
}
}
$icon = check_url("$adres");
echo "$icon [url=$adres] $name [/url]";
}
?>
It works if I put in a single link in to the textarea. But I want it to work if I put in more then one link.