Please help me with this. I am not a good in explaining and my grammar is not that good so please bear with me.
My client wants a website which auto search a manufacturing part number from a certain website.
The code for the auto search is working and there's no error. However, my client wants to check for each manufacturing part number which is saved from database if it have a search result here is my code:
$searchmfgpn =@mysql_query("select mfg_pn from bom_crunching; ");
//@mysql_query($searchmfgpn,$connect)or die("Failed to execute query:<br />" . mysql_error(). "<br />" . mysql_errno());
while($row = mysql_fetch_array($searchmfgpn))
{
$searchkeyword =$row['mfg_pn'];
echo "<pre>";
echo $searchkeyword;
echo "</pre>";
$digipart ="http://www.digipart.com/part/".$searchkeyword;
//echo "<iframe src=".$digipart." width ='1200' height ='600'></iframe>";
$string = "We are sorry, but no result was found for '$searchkeyword' Please try again.";
if (strpos($digipart,$string) !== false) {
echo 'Not Available.';
} else {
echo 'Available';
}
}
the code didn't gave me any errors, however the code I used to check if it is available or not is incorrect. It only check for the URL. I want to check for the whole page, which is I don't know what code should I use.
How can I fixed this? Any help will be appreciated!!