I testing using curl for post. i created 3 php files "app, source, result". first php is app to post. second is source. third to process post value. How to post from app to source.php and get result,php. I get nothing.
first php
$data = [ 'user' => 'myself' ];
$headers = [
"User-Agent: Opera/9.80 (J2ME/MIDP; Opera Mini/4.0.10992/35.5561; U; hr) Presto/2.8.119 Version/11.10",
"Content-Type: application/x-www-form-urlencoded",
];
$options = [
CURLOPT_POST => TRUE,
CURLOPT_POSTFIELDS => $data,
CURLOPT_HTTPHEADER => $headers
];
$ch = curl_init("localhost/source.php');
curl_setopt_array($ch, $options);
$res = curl_exec($ch);
curl_close($ch);
echo $res;
Source php
<form action="result.php" method="post">
<input type="hidden" name="user">
</form>
Result php
<?php
if(isset($_POST['user'])){ echo $_POST['user']; }
?>