I have a simple PHP based client for a Web Service.
I want to pass the value that inputed by user to the url but with PUT metho because the POST method not supported it.
Here is my Client code
<!DOCTYPE html>
<?php
$ip = '172.27.40.113';
$url = 'http://'.$ip.'/service/aca/public/all-produk-by-id/2';
$string = file_get_contents($url);
$json_a = json_decode($string, true);
$req = 'http://'.$ip.'/service/aca/public/request-produk-branch/2';
?>
<table border="1">
<th width="50">ID PB</th>
<th width="100">ID Produk</th>
<th width="100">Stok</th>
<th width="100">Order</th>
<?php
foreach($json_a['data'] as $item){
echo '<tr>';
echo '<td align="center">'.$item['id_PB'].'</td>';
echo '<td align="center">'.$item['id_produk'].'</td>';
echo '<td align="center">'.$item['stok'].'</td>';
echo '<td align="center">'.
'<form method="POST" action="'. $req . '/' . $item['id_produk'] . '/?jumlah=">'.
'<input type="hidden" name="_METHOD" value="PUT">'.
'<input name="jumlah" type="number" min="1" max="'.$item['stok'].'" placeholder="Value">'.
'<input type="submit" value="Order">'.
'</form>'.
'</td>';
echo '</tr>';
}
?>
</table>
If I delete the <input type="hidden" name="_METHOD" value="PUT">, the value will show in the url. But it can't be proceed because its using POST method.
But if we use <input type="hidden" name="_METHOD" value="PUT">, the value wont show in the url, but it use PUT method.
How can I pass that value to the url and using PUT Method?
Please help me.