html - PHP Curl get contents from external site -


i tried contents our main website microsite, microsite pull contents main site without db.

i used curl this, new on curl when tried parsing content showed tittle, img, , teaser text (which far). want next is, when user clicked title link details article not jumping main site (original site/source).

any clue how this?

my code is:

$curl = curl_init('http://www.mainsite.com/indeks/64/');  curl_setopt($curl, curlopt_returntransfer, true);  $page = curl_exec($curl);  if(curl_errno($curl)) // check execution errors {     echo 'scraper error: ' . curl_error($curl);     exit; }  curl_close($curl);  $regex = '/<ul class="list_indeks">(.*?)<\/ul>/s'; if ( preg_match($regex, $page, $list) )     echo $list[0]; else      print "not found";  

thanks helps


Comments