tazeha Posted April 18, 2014 Share Posted April 18, 2014 Hello I using PHP Simple HTML DOM Parser . Now I write the mini script . This script find the products online shopping with price. but one problem is. <?phpinclude_once('simple_html_dom.php');// Create DOM from URLheader("Refresh: 300;");$html = file_get_html('http://wpu.ir/v3128');$articles = array();// Find all article blocksforeach($html->find('div#content') as $article) { $item['title'] = $article->find('h1', 0)->plaintext; $item['intro'] = $article->find('h3', 0)->plaintext; $item['details'] = $article->find('span.finalprice', 0)->plaintext; $articles[] = $item;}echo $title="<b>نام محصول:</b>". $item['title'] . "</br> ";echo $dec="<b>توضیحات:</b> ". $item['intro'] . "</br> "; echo $pr="<b>قیمت:</b> ". $item['details'] . " </br> "; //to fetch all images from a webpage$images = array();foreach($html->find('img') as $img) { $images[] = $img->src;}echo " $images[29]";?> the product's detail's. name price image description ... in this loop foreach($html->find('img') as $img) { $images[] = $img->src;}echo " $images[29]"; only display the image url not imge. please help Link to comment Share on other sites More sharing options...
thescientist Posted April 18, 2014 Share Posted April 18, 2014 put the src an image tag. echo '<img src="' . $images[29] . '" />'; make sure 29 is a valid index 1 Link to comment Share on other sites More sharing options...
tazeha Posted June 18, 2014 Author Share Posted June 18, 2014 how save price with product name in database mysql.. Link to comment Share on other sites More sharing options...
Don Jajo Posted June 18, 2014 Share Posted June 18, 2014 Take a look - http://www.w3schools.com/php/php_mysql_insert.asp Link to comment Share on other sites More sharing options...
thescientist Posted June 18, 2014 Share Posted June 18, 2014 how save price with product name in database mysql.. please make a new thread / post if you have a new question different from the first post of this thread 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now