Receiving data from php curl to another php file -


i trying send data 1 php file on webserver webserver using curl, unsure how access data sent second webserver work. able access data before using $_post array curl being used send data no longer able use reason. can point me in right direction on how access data?

function post_to_url($url, $data) {    $fields = '';   foreach($data $key => $value) {     $fields .= $key . '=' . $value . '&';    }    rtrim($fields, '&'); //dl: ugh.    $post = curl_init();    curl_setopt($post, curlopt_url, $url);    curl_setopt($post, curlopt_post, count($data));    curl_setopt($post, curlopt_postfields, $fields);    curl_setopt($post, curlopt_returntransfer, 1);    $result = curl_exec($post);    curl_close($post); }  

that code using curl post itself, here receiving end $username = $_post['email'];

if using curl make sure post:

  curl_setopt($ch, curlopt_post, 1);   curl_setopt($ch, curlopt_postfields, $array()); 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -