- Messages
- 1
- Likes
- 0
- Points
- 1
I have some problem for this plugin.
1) I'd try to make an order form on my wordpress site that must use PHP code. When I creating PHP Code in text editor Gutenberg on Wordpress 5.0.2, I used code [insert_php] [/insert_php] for alternate of <php ?> then wordpress can't saving or publishing it page even through I get preview mode then it's code is work corectly. But the problem is I can't publish my new page even I use that's alternate code.
2) After that I tried to put that code on snippet and it has work as I hope
then I tried to delete a database that I didn't use at all from cPanel, but, I've got blank page with “Koneksi gagal” words on every pages of my wordpress. I think it can be happened 'cause I deleted a database, but I wrong because it is nothing in deleted database.
*sorry for my bad english, I hope u understand what I mean
The deleted database is "aqiqahbe_input-form"
Database I used is "aqiqahbe_orderan"
This my snippet code :

1) I'd try to make an order form on my wordpress site that must use PHP code. When I creating PHP Code in text editor Gutenberg on Wordpress 5.0.2, I used code [insert_php] [/insert_php] for alternate of <php ?> then wordpress can't saving or publishing it page even through I get preview mode then it's code is work corectly. But the problem is I can't publish my new page even I use that's alternate code.
2) After that I tried to put that code on snippet and it has work as I hope
*sorry for my bad english, I hope u understand what I mean
The deleted database is "aqiqahbe_input-form"
Database I used is "aqiqahbe_orderan"
This my snippet code :
PHP:
$host =”localhost”; //host server
$user =”aqiqahbe”; //user login phpMyAdmin
$pass =”1Cgf5kO1n5″; //pass login phpMyAdmin
$db =”aqiqahbe_orderan”; //nama database
$conn = mysqli_connect($host, $user, $pass, $db) or die (“Koneksi gagal”);
if($_SERVER[‘REQUEST_METHOD’] == “POST”){
$name = $_REQUEST[‘nama’];
$pkt = $_REQUEST[‘paket’];
$tlp = $_REQUEST[‘telp’];
$imail = $_REQUEST[’email’];
$hr = $_REQUEST[‘tanggal’];
$jam = $_REQUEST[‘waktu’];
$alm = $_REQUEST[‘alamat’];
$cttn = $_REQUEST[‘catatan’];
$submit = $_REQUEST[‘submit’];
function ubahTanggal($hr){
$pisah = explode(‘/’,$hr);
$array = array($pisah[2],$pisah[0],$pisah[1]);
$satukan = implode(‘-‘,$array);
return $satukan;
}
$tgl = ubahTanggal($hr);
$mysqli = “INSERT INTO order_tabel (nm, paket, tlp, mail, tgl, wkt, addr, note) VALUES (‘$name’, ‘$pkt’, ‘$tlp’,’$imail’,’$tgl’,’$jam’,’$alm’,’$cttn’)”;
if(isset($submit)){
if(empty($name) or empty($pkt) or empty($tlp) or empty($tgl) or empty($jam) or empty($alm)){
echo “<script>window.alert(‘Maaf, form tidak boleh kosong…’)</script>”;
} else {
$result = mysqli_query($conn, $mysqli);
}
if ($result) {
echo ”<center>Pemesanan berhasil<br>Silakan segera hubungi kontak kami untuk konfirmasi pemesanan</center>”;
} else {
echo “<center>Pemesanan gagal<br>Mohon coba lagi</center>”;
}
}
mysqli_close($conn);
}

Last edited: