I want to use PHP's cURL to visit a page on an external site, and get some the whole html content of the page.
When i visit the site, it will redirect me to another page on the same site. Also, i have to set the useragent, i want a useragent for PC windows7 chrome and iPhone 4s. This is what i got so far:
$ch = curl_init ($url);
curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
curl_setopt($ch, CURLOPT_AUTOREFERER , true)
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$kl = curl_exec ($ch);
curl_close($ch);
echo $kl;
Notice:
I will probably run into more errors.
DOMXPathorsimple_xml_element->xpath()