Guys i have a problmm and i want your help.Actually i want to POST a value to php file without redirect me to this file... My form:
<form method="post" role="form" action="">
<div class="form-group">
<label>Change threshold:</label>
<input name="thr" class="form-control" id="thr" placeholder="Enter Threshold">
</div>
<button type="submit" class="btn btn-default" name="thre" >Change</button>
</form>
I tried a curl post call but it didn't work. My call:
if (isset($_POST['thre'])) {
$value=$_POST['thr'];
$json_string='{"thr":"'.$value.'"}';
$url = 'http://147.27.50.55/IDM/subsc.php';
$curl = curl_init( $url );
curl_setopt($curl,CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $json_string);
curl_setopt($curl3, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Content-Length: ' . strlen($json_string))
);
$result=curl_exec($curl);
curl_close($curl);
}
Finally i want get teh value like this:
$v=$_GET['$value'];
Where is the problem?