<?php // // A very simple PHP example that sends a HTTP POST to a remote site // $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://www.example.com/tester.phtml"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "postvar1=value1&postvar2=value2&postvar3=value3"); // In real life you should use something like: // curl_setopt($ch, CURLOPT_POSTFIELDS, // http_build_query(array('postvar1' => 'value1'))); // Receive server response ... curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $server_output = curl_exec($ch); curl_close ($ch); // Further processing ... if ($server_output == "OK") { ... } else { ... } ?>
Related Posts:
- How do I get a YouTube video thumbnail from the YouTube API?
- What’s the net::ERR_HTTP2_PROTOCOL_ERROR about?
- Can curl make a connection to any TCP ports, not just HTTP/HTTPS?
- Call to undefined function curl_init().?
- How do I get a YouTube video thumbnail from the YouTube API?
- CURL ERROR: Recv failure: Connection reset by peer – PHP Curl
- cURL error 60: SSL certificate: unable to get local issuer certificate
- curl POST format for CURLOPT_POSTFIELDS
- HTTP Error 411, The request must be chunked or have a content length
- PHP cURL custom headers
- PHP cURL HTTP PUT
- How to send a GET request from PHP?
- file_get_contents( ) not working
- Error:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
- Setting Curl’s Timeout in PHP
- How to POST JSON Data With PHP cURL?
- cURL request in Laravel
- How do I make a redirect in PHP?
- List of All Locales and Their Short Codes?
- Whoops, looks like something went wrong. Laravel 5.0
- PHP “or” Syntax
- PDOException SQLSTATE[HY000] [2002] No such file or directory
- How do I check if a string contains a specific word?
- Get the full URL in PHP
- How to copy a file from one directory to another using PHP?
- How can I find my php.ini on wordpress?
- mysqli_real_connect(): (HY000/2002): No such file or directory
- $wpdb->update or $wpdb->insert results in slashes being added in front of quotes
- Are there dictionaries in php?
- laravel updateOrCreate method
- How to listen messageSent event in laravel 5.5
- Mixing a PHP variable with a string literal
- Make a HTTPS request through PHP and get response
- How do the PHP equality (== double equals) and identity (=== triple equals) comparison operators differ?
- pdo – Call to a member function prepare() on a non-object
- Compare given date with today
- Difference between $_SERVER[‘DOCUMENT_ROOT’] and $_SERVER[‘HTTP_HOST’]
- Multi-line strings in PHP
- Commands out of sync; you can’t run this command now
- Refresh a page using PHP
- Laravel 5.2 Storage::makeDirectory($dir) is not creating directory
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- Replace spaces with a dash in a URL
- Are PDO prepared statements sufficient to prevent SQL injection?
- Message: Trying to access array offset on value of type null [duplicate]
- retrieve data from db and display it in table in php .. see this code whats wrong with it?
- Count how many files in directory PHP
- Simple PHP calculator
- Convert from MySQL datetime to another format with PHP
- Child theme css not overriding parent
- php foreach with multidimensional array
- Convert timestamp to readable date/time PHP
- Creating a php search bar
- header location not working in my php code
- PHP Error: Function name must be a string
- Uncaught Error: Call to undefined function mysql_escape_string()
- What does ‘=' mean in PHP?
- Warning: mysqli_query() expects at least 2 parameters, 1 given. What? [duplicate]
- Laravel 5 MethodNotAllowedHttpException in RouteCollection.php line 201:
- PHP “&” operator
- What is ?
- Connection reset by peer: mod_fcgid: error reading data from FastCGI server
- Warning: A non-numeric value encountered
- How to import csv file in PHP?
- What is the syntax for accessing PHP object properties?
- Proper Format of iframe in PHP?
- How to find the last day of the month from date?
- php_network_getaddresses: getaddrinfo failed: Name or service not known (0) Failed To Connect..!
- Composer: Command Not Found
- * failed to open vchiq instance
- Undefined variable: $_SESSION
- Mysql where id is in array
- How to extract and access data from JSON with PHP?
- Warning “Do not Access Superglobal $_POST Array Directly” on Netbeans 7.4 for PHP
- Call a REST API in PHP
- Fatal error: Call to a member function query() on null
- How can I write php code in notepad++?
- Insert string at specified position
- PHP + JQuery – How to use these two together? Please see my example
- How to run a PHP function from an HTML form?
- How to insert TIMESTAMP into my MySQL table?
- Remove warning messages in PHP
- create php live clock
- Converting a UNIX Timestamp to Formatted Date String
- PHP Call to undefined function
- Formatting a number with leading zeros in PHP
- Undefined index with $_POST [duplicate]
- file_get_contents() how to fix error “Failed to open stream”, “No such file”
- POST an array from an HTML form without javascript
- wordpress menu dropdown item not showing after first dropdown
- Where to get information about array fields in $_REQUEST?
- cURL 28 error after switch from to brew php 7.2 on localhost
- Creating a post with the REST API, curl and oauth returning 401 error
- cURL error 60: SSL certificate problem: unable to get local issuer certificate
- Use wp_remote_get to get JSON instagram feed from public profile
- Programmatic Login from 3rd Party site
- WordPress from url get external source title
- WordPress transient not working with WP Engine
- Get full page HTML for a non-public WordPress page