There may be a time where you find yourself needing to request a page from another website for inclusion, one of the easiest and more secure ways is to use a PHP Function called Curl. (If you have troubles getting this to work your server may not have this PHP function installed, if so kindly ask your server administrator to install it from: www.php.net/curl )

This code can be very useful to include, weather forecasts and other data from another website, please take mind of copyright laws, and always ask the website admin if you would like to use content from his/her website.

Basically just add the code below into a node, making sure that the Input Format is a PHP Page.


<?php

$curl_handle=curl_init();
//This is the URL you would like the content grabbed from
curl_setopt($curl_handle,CURLOPT_URL,'http://www.google.com');
//This is the amount of time in seconds until it times out, this is useful if the server you are requesting data from is down. This way you can offer a "sorry page"
curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2);

curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);
$buffer = curl_exec($curl_handle);
//This Keeps everything running smoothly
curl_close($curl_handle);

// Change the message bellow as you wish, please keep in mind you must have your message within the " " Quotes.
if (empty($buffer))
{
    print "Sorry, It seems our weather resources are currently unavailable, please check back later.";
}
else
{
    print $buffer;
}
?>