Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php curl post application/x-www-form-urlencoded

//this send application/x-www-form-urlencoded                                                                                                     
 function httpPostXform($url, $data) {                                                                 
    $curl = curl_init($url);                                                                            
    curl_setopt($curl, CURLOPT_POST, true);                                                             
    curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));                                    
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);                                                   
    curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));   
    $response = curl_exec($curl);                                                                       
    curl_close($curl);                                                                                  
    return $response;                                                                      
}                                                                                                       
$r = httpPostXform("https://www.somesite.com",array("user_id"=>10,"sex"=>"male"));
Comment

PREVIOUS NEXT
Code Example
Php :: mysql replace a character in a string 
Php :: Hours to minute convert in php 
Php :: laravel favicon 
Php :: how to remove first element in array php 
Php :: laravel module create controller 
Php :: laravel storage check file exists 
Php :: check image is available on server php 
Php :: avoid php self exploit 
Php :: check if a string contains a substring php 
Php :: compare hashed password and a text password in laravel 
Php :: php timestamp to date 
Php :: php time limit 
Php :: error log php array 
Php :: php ellipsis 
Php :: how to set timezone for iran in laravel 
Php :: Add [nom] to fillable property to allow mass assignment 
Php :: php curl verbose 
Php :: get php memory limit command line 
Php :: what php can do 
Php :: php clean html tags 
Php :: codeigniter get user ip 
Php :: test a single file laravel 
Php :: php remove span tags from string 
Php :: php set error log file 
Php :: 419 unknown status 
Php :: encryption key has not encrypted laravel 
Php :: Remove “/public” from Laravel route 
Php :: CAPTURAR URL PHP 
Php :: convert string to decimal php 
Php :: get template part pass variable 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =