Handy cURL Source for Drupal Nodes
Submitted by alan on Thu, 11/17/2011 - 11:52
I frequently need to link the content of an external page for display on a Drupal site. An example is a privacy policy that is periodically updated. If a link to this page is undesirable, another option is to use PHP cURL functions to display that content inside a node with a PHP input format.
<?php
$url = "http://www.company.com/privacy.html";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
echo $result;
?>
$url = "http://www.company.com/privacy.html";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
echo $result;
?>