Postingan lainnya
PHP Header location
case 'simpanbarang':
$kode_barang = $_REQUEST['kode_barang'];
$kode_trx_pembelian = $_REQUEST['kode_trx_pembelian'];
$jml_beli = $_REQUEST['jml_beli'];
mysqli_query($koneksi,"insert into pembelian(KODE_BARANG,KODE_TRX_PEMBELIAN,JUMLAH_PEMBELIAN) values ('$kode_barang','$kode_trx_pembelian','$jml_beli')");
header("location:?page=detail&id=".$kode_trx_pembelian);
break;
Saat dijalankan error dan muncul " Warning: Header may not contain more than a single header, new line detected"
0
2 Jawaban:
<div>di coba mas </div><pre>header("Location: ?page=detail&id=" . $kode_trx_pembelian);</pre>
0
Tanggapan
masih sama mas, tetap error.
<pre>$code = "?page=detail&id='$kode_trx_pembelian'"; $url=str_replace(PHP_EOL,'', $code"); header("Location: $url);</pre><div><br>coba lagi mas ini</div>
0