正在制作产品登记表。我试图在运行查询之前检查空白表单或相同的产品代码。问题是,当我运行该页面。甚至当我填写表格的inputNamaProduk
我离开了其他空白,我得到的$message
空白inputNamaProduk
if else not in php [嵌套]
if(strlen($_POST['inputNamaProduk'])>=0)
{
$form = true;
$message = '<p>Sila Isi Nama Produk.</p>';
}
else
{
if(strlen($_POST['inputSpesifikasi'])>=0)
{
$form = true;
$message = '<p>Sila Isi Spesifikasi Produk.</p>';
}
else
{
if ($dn==0)
$query = mysql_query("INSERT INTO `produk2`
(product_code,product_name,product_desc,product_type,price,product_img,product_img_name)
VALUES ('$kod','$namaproduk','$spesifikasi','$jenis','$harga','$image','$name')");
else
{
$form = true;
$message = '<p>Sila Pilih Kod Produk Lain.</p>';
}
}
}