Note that there are some explanatory texts on larger screens.

plurals
  1. POLoading content from remote site doesn't work, but why?
    primarykey
    data
    text
    <p>I'm still working on this catalogue for a client, which loads images from a remote site via PHP and the Simple DOM Parser.</p> <pre><code>// Code excerpt from http://internetvolk.de/fileadmin/template/res/scrape.php, this is just one case of a select $subcat = $_GET['subcat']; $url = "http://pinesite.com/meubelen/index.php?".$subcat."&amp;lang=de"; $html = file_get_html(html_entity_decode($url)); $iframe = $html-&gt;find('iframe',0); $url2 = $iframe-&gt;src; $html-&gt;clear(); unset($html); $fullurl = "http://pinesite.com/meubelen/".$url2; $html2 = file_get_html(html_entity_decode($fullurl)); $pagecount = 1; $titles = $html2-&gt;find('.tekst'); $images = $html2-&gt;find('.plaatje'); $output=''; $i=0; foreach ($images as $image) { $item['title'] = $titles[$i]-&gt;find('p',0)-&gt;plaintext; $imagePath = $image-&gt;find('img',0)-&gt;src; $item['thumb'] = resize("http://pinesite.com".str_replace('thumb_','',$imagePath),array("w"=&gt;225, "h"=&gt;162)); $item['image'] = 'http://pinesite.com'.str_replace('thumb_','',$imagePath); $fullurl2 = "http://pinesite.com/meubelen/prog/showpic.php?src=".str_replace('thumb_','',$imagePath)."&amp;taal=de"; $html3 = file_get_html($fullurl2); $item['size'] = str_replace(' &amp;nbsp;','',$html3-&gt;find('td',1)-&gt;plaintext); unset($html3); $output[] = $item; $i++; } if (count($html2-&gt;find('center')) &gt; 1) { // ok, multi-page here, let's find out how many there are $pagecount = count($html2-&gt;find('center',0)-&gt;find('a'))-1; for ($i=1;$i&lt;$pagecount; $i++) { $startID = $i*20; $newurl = html_entity_decode($fullurl."&amp;beginrec=".$startID); $html3 = file_get_html($newurl); $titles = $html3-&gt;find('.tekst'); $images = $html3-&gt;find('.plaatje'); $a=0; foreach ($images as $image) { $item['title'] = $titles[$a]-&gt;find('p',0)-&gt;plaintext; $item['image'] = 'http://pinesite.com'.str_replace('thumb_','',$image-&gt;find('img',0)-&gt;src); $item['thumb'] = resize($item['image'],array("w"=&gt;225, "h"=&gt;150)); $output[] = $item; $a++; } $html3-&gt;clear(); unset ($html3); } } echo json_encode($output); </code></pre> <p>So what it should do (and does with some categories): Output the images, the titles and the the thumbnails from this page: <a href="http://pinesite.com" rel="nofollow">http://pinesite.com</a></p> <p>This works, for example, if you pass it a "?function=images&amp;subcat=antiek", but not if you pass it a "?function=images&amp;subcat=stoelen". I don't even think it's a problem with the remote page, so there has to be an error in my code.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload