@', $mainPage, $leftMenu1)) echo "Can not find the First Left Menu!"; else{ //echo "First Left Menu
";print_r($leftMenu1[1]);echo "
"; } $bilgisayar = $leftMenu1[1]; $bilgisayarCategory = file_get_contents("http://www.hepsiburada.com/$bilgisayar[0]"); if (!preg_match_all('@
@', $bilgisayarCategory, $leftMenu2)) echo "Can not find the Second Left Menu!"; else{ //echo "Second Left Menu
";print_r($leftMenu2[1]);echo "
"; } $modem = $leftMenu2[1]; $modemPage = file_get_contents("http://www.hepsiburada.com/$modem[0]"); if (!preg_match_all('@
(.*)@', $modemPage, $productId)) echo "Can not find the Product Name!"; else{ //echo "Product Name
";print_r($productId);echo "
"; } $productNames = $productId[3]; $productIds = $productId[2]; //echo "Product Names are:
";print_r($productNames);echo "
"; //echo "Product ID's are:
";print_r($productIds);echo "
"; if (!preg_match_all('@
";print_r($productImg);echo "
"; } $productLink = $productImg[1]; $productImgLink = $productImg[3]; //echo "Product Links are:
";print_r($productLink);echo "
"; //echo "Product Image Links are:
";print_r($productImgLink);echo "
"; /*preg_match_all('@http://images.hepsiburada.com/assets/Bilgisayar/80/(.*)@', $productImgLink, $productImgName); echo "Product Image Names are:
";print_r($productImgName);echo "
";*/ if (!preg_match_all('@
";print_r($productImgId[3]);echo "
"; } $productImageId = $productImgId[3]; if (!preg_match_all('@(.*)\(KDV Dahil\)@', $modemPage, $productPrice)) echo "Can not find the Product Price!"; else{ //echo "Product Prices are:
";print_r($productPrice[3]);echo "
"; } $productPrices = $productPrice[3]; $dropTable = "DROP TABLE `product`;"; $results1 = mysql_query($dropTable) or die('Unable to execute query [$dropTable]'.mysql_error()); $createTable = "CREATE TABLE `product` ( `id` int(11) NOT NULL auto_increment, `productName` varchar(225) character set utf8 collate utf8_unicode_ci, `productId` varchar(225) character set utf8 collate utf8_unicode_ci, `productLinks` varchar(225) character set utf8 collate utf8_unicode_ci, `productPrice` varchar(225) character set utf8 collate utf8_unicode_ci, `productImgLinks` varchar(225) character set utf8 collate utf8_unicode_ci, `productImgName` varchar(225) character set utf8 collate utf8_unicode_ci, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARACTER SET utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;"; $results2 = mysql_query($createTable) or die('Unable to execute query [$createTable]'.mysql_error()); foreach ($productNames as $productNames2) { $q1 = "INSERT INTO product(productName) VALUES('$productNames2');"; $result1 = mysql_query($q1) or die('Unable to execute query [$q1]'.mysql_error()); } $i = 1; foreach ($productIds as $productIds2) { $q2 = "UPDATE product set productId='$productIds2' WHERE id='$i'"; $result2 = mysql_query($q2) or die('Unable to execute query [$q2]'.mysql_error()); $i = $i + 1; } $i = 1; foreach ($productLink as $productLinks) { $q3 = "UPDATE product set productLinks='$productLinks' WHERE id='$i'"; $result3 = mysql_query($q3) or die('Unable to execute query [$q3]'.mysql_error()); $i = $i + 1; } $i = 1; foreach ($productPrices as $productPrices2) { $q4 = "UPDATE product set productPrice='$productPrices2' WHERE id='$i'"; $result4 = mysql_query($q4) or die('Unable to execute query [$q4]'.mysql_error()); $i = $i + 1; } $i = 1; foreach ($productImgLink as $productImgLinks) { $q5 = "UPDATE product set productImgLinks='$productImgLinks' WHERE id='$i'"; $result5 = mysql_query($q5) or die('Unable to execute query [$q5]'.mysql_error()); $i = $i + 1; } $i = 1; foreach ($productImageId as $productImageIds) { $q6 = "UPDATE product set productImgName='$productImageIds' WHERE id='$i'"; $result6 = mysql_query($q6) or die('Unable to execute query [$q6]'.mysql_error()); $i = $i + 1; } ?>
Hepsiburada.com


"; } echo " "; if ($k%2!=0) { echo ""; } $j = $j + 1; $k = $k + 1; } ?>
".$record[1]." ".$record[4]."
(KDV Dahil)