WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World
Perform a cURL session

curl_exec

(PHP 4 >= 4.0.2, PHP 5)

curl_execPerform a cURL session

Description

mixed curl_exec ( resource $ch )

Execute the given cURL session.

This function should be called after initializing a cURL session and all the options for the session are set.

Parameters

ch

A cURL handle returned by curl_init().

Return Values

Returns TRUE on success or FALSE on failure. However, if the CURLOPT_RETURNTRANSFER option is set, it will return the result on success, FALSE on failure.

Examples

Example #1 Fetching a web page

<?php
// create a new cURL resource
$ch curl_init();

// set URL and other appropriate options
curl_setopt($chCURLOPT_URL"http://www.example.com/");
curl_setopt($chCURLOPT_HEADER0);

// grab URL and pass it to the browser
curl_exec($ch);

// close cURL resource, and free up system resources
curl_close($ch);
?>

See Also


Is there any way in which functions can be placed in separate files and included/called when needed as with C? The manual mentions exec() and passthru but as far as I can see this is not what I am looking for!
Categories : PHP, Filesystem
Sign-in To Amazon.com with PHP CURL
Categories : PHP, CURL
Using cURL to get login to yahoo.com by Porosh
Categories : PHP, CURL



A script using Windows Scripting Host 1.0 can be executed on a scheduled basis from Windows NT's scheduler. This is useful for system administrators to run unattended tasks
Categories : WinNT
randomly display aphorisms using php to execute a UNIX 'fortune' script
Categories : PHP
who.php3 - prints a summary of the current activity on the system, including what each user is doing and where they are logged if from. PHP3 functions: exec, ereg System: IRIX 6.3
Categories : Complete Programs, PHP
A database abstraction layer for the PHP 3.0 ODBC module. It supports persistent connections, fetching rows into arrays, prepare/execute (variable binding) and has a new and improved error interface.
Categories : Databases, PHP, Complete Programs
Sample AIM (Advanced Integration Method) PHP Script For Authorize.net using CURL
Categories : CURL, Ecommerce, PHP
Buggy is a PHP class that allows to store relevant informations while running a PHP script so it can be analysed to find bugs, or any problem in code execution.
Categories : PHP, PHP Classes, Debugging
Getting the directory listing of a directory with exec().
Categories : PHP
Prevent Standalone Execution of a PHP Script
Categories : PHP, Security
PHP ZIP file creation on a linux box using exec. Create ZIP files containing images
Categories : PHP, Compression, Filesystem
ElfReader: An ELF (Executable and Linking Format) header information in PHP. Shows how to use the UNPACK function to read data.
Categories : PHP, Linux, PHP Classes
Amazon.com API, CURL-REST Parser. Obtain data about Amazon products (PHP5 +)
Categories : PHP, Ecommerce, XML, Web Services, CURL