Soo, i have a form that i use to send data to mysql but when i click submit the form didnt send anything to mysql but there is no error shown either. I also try var_dump($_POST)
and it show no data. How'd i fix it? thanks.
The code:
<?php
include '../koneksi.php';
$awal_sewa = $_POST['awal_sewa'];
$akhir_sewa = $_POST['akhir_sewa'];
$number_days = ((strtotime($akhir_sewa) - strtotime($awal_sewa)) / (60 * 60 * 24));
$total_price = 0;
$harga = mysqli_query($koneksi, "select harga from kamar");
$id = $_GET['id'];
$data = mysqli_query($koneksi,"select * from kamar where id='$id'");
while($d = mysqli_fetch_array($data)){
$total_price = $number_days * $d['harga'];
?>
<form role="form" action="store.php">
<input type="hidden" name="id_kamar" class="inside" value="<?php echo $d['id']; ?>">
<input type="date" class="form-control" name="konfirmasi_awal_sewa" placeholder="Enter Number" value="<?php echo $awal_sewa; ?>" readonly>
<input type="date" class="form-control" name="konfirmasi_akhir_sewa" placeholder="" value="<?php echo $akhir_sewa; ?>" readonly>
<input type="text" class="form-control col-sm" name="total_hari" value="<?php echo (int)$number_days;?> hari" readonly>
<input type="text" class="form-control col-sm" name="total_harga" value="Rp<?php echo (int)$total_price;?>,-" readonly>
<?php
}
?>
<button type="submit" class="btn btn-primary">Sewa</button>
</form>
Store.php:
<?php var_dump($_POST); ?>