[ALUG] Using curl (or similar) bypassing DNS

Mark Rogers mark at quarella.co.uk
Mon Jun 1 16:20:24 BST 2009


Mark Rogers wrote:
> Those two look perfect, thanks!

In case anyone cares, the PHP version would be (using the curl library):

  <?php
  $ch = curl_init('http://209.85.229.147/search?q=test');
  curl_setopt ($ch, CURLOPT_HTTPHEADER, array('Host: www.google.co.uk'));
  curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);
  $html = curl_exec($ch);
  echo $html;
  ?>

-- 
Mark Rogers // More Solutions Ltd (Peterborough Office) // 0845 45 89 555
Registered in England (0456 0902) at 13 Clarke Rd, Milton Keynes, MK1 1LG




More information about the main mailing list