Last active
March 20, 2018 12:32
-
-
Save morozVA/9c78057add32906a9ee429cf5b1a32bf to your computer and use it in GitHub Desktop.
php curl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$url = "https://online.moysklad.ru/api/remap/1.1/report/stock/all?&limit=100&offset=".$offset; | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_USERPWD, "api@media-group : pass"); | |
$result = curl_exec($ch); | |
curl_close($ch); | |
$array = json_decode($result, true); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'https://events.sendpulse.com/events/id/id'); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_POST, true); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, '{ | |
"email": "'.$_POST['email'].'", | |
"phone": "'.$_POST['phone'].'", | |
"product_name": "'.$_POST['product_name'].'", | |
"product_id": '.$_POST['product_id'].', | |
"product_price": "'.$_POST['product_price'].'", | |
"event_date": "'.$_POST['event_date'].'" | |
}'); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); | |
$out = curl_exec($ch); | |
curl_close($ch); | |
echo $out; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment