Most Rated Articles

Installing Apache and Apache Modules the easy way

The Essential steps on how to Sysprep Windows 7

SSH is very much similar to telnet. SSH is a shell program which allows a user remote access and the ability to execute commands over a network.

It is important to protect your wireless networks from unwanted and abusive users. Unauthorized users may reduce the bandwidth and may lock up your network

There are many methods on how to optimize apache. It could be on the software side, but upgrading the hardware also makes a difference.

With Windows 7 as a new OS in the market, one may worry about any problems that could be encountered especially network issues such as compatibility with older OS. Windows 7 might encounter problems communicating with older Windows models such as XP. The following are ways on how to network Windows 7 and XP.

One way of installing windows over the network is through the use of RIS or Remote Installation Services. However, you must have the following prerequisites in order to install Windows over the network.

Installing a printer on a mac is just as easy as installing a printer on an OS of Windows. The following steps are just some of the steps on how to connect your printer a Mac operating system.

Nowadays, it is important to have access to Wi-Fi. However, not everyone has their own internet connection so most people leech wherever there is free Wi-Fi. Most routers with Wi-Fi access require passwords but nowadays, there are other places to look around and search for free Wi-Fi.

Some applications cannot install in Windows 7 due to incompatibility issues. A solution would be to enable XP mode in a virtual environment of Windows 7. This configuration may be used to run and install programs that were incompatible in Windows 7.

Programming  »  PHP
 Picture

How to use cURL in PHP

By: Anton Locsin
Date Added : June 19, 2010 Views : 288



cURL, otherwise known as Client URL, is a powerful PHP extension that is designed to download/upload content and data from/to other URLs. This command line tool was created by Daniel Stenberg in 1998.

The first step is to install the cURL extension in PHP.  The cURL version you need would vary with the PHP version that you have.

Below is a basic example on how to use cURL.

$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,'http://mywebsite.com');
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5);
curl_exec($ch);
curl_close($ch);
?>
 

The first line initializes the cURL handle, while the second line sets the URL that you want to access. The third line sets the option to load a page within 5 seconds before timing out. This will ensure that pages that take too long to load will only load within 5 seconds. curl_exec() executes the handle while curl_close() closes the handle. The example above shows a basic cURL function to retrieve 5 seconds of data from mywebsite.com.
 
The options in cURL vary and have different functions. curl_seropt() is considered as the most challenging area in the cURL library because you need to understand each option and their functions. A list of all the cURL options may be found online.

cURL can be used in a wide array of sorts. Whether you use cURL to retrieve web pages, download content, authentication use, cURL is an effective alternate to access these services while saving a lot of time.




Article Categories