File: /var/www/html/StripeBackend/test_input.php
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
/*
function httpPost($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);
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
$url = "https://47.242.152.148/StripeBackend/response.php";
$data = array(
'email' => "test1",
'name' => "test2",
'phone' => "1234567890"
);
echo $stripe_user_id = httpPost($url, $data);
*/
$url = 'http://47.242.152.148/StripeBackend/response.php';
$data = array('key1' => 'value1', 'key2' => 'value2');
// use key 'http' even if you send the request to https://...
$options = array(
'http' => array(
'header' => "Content-type: application/x-www-form-urlencoded\r\n",
'method' => 'POST',
'content' => http_build_query($data)
)
);
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
if ($result === FALSE) { /* Handle error */ }
var_dump($result);
?>