You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.3 KiB
42 lines
1.3 KiB
<?php
|
|
$combono= "";
|
|
$part= "";
|
|
$partid= "";
|
|
$comboitem= "";
|
|
$detail= "";
|
|
$enable= "";
|
|
$creater= "";
|
|
$create_at= "";
|
|
|
|
$combono_error= "";
|
|
$part_error= "";
|
|
$partid_error= "";
|
|
$comboitem_error= "";
|
|
$detail_error= "";
|
|
$enable_error= "";
|
|
$creater_error = "";
|
|
$create_at_error = "";
|
|
|
|
|
|
if($_SERVER["REQUEST_METHOD"] == "POST"){
|
|
include "combo-user-input.php";
|
|
|
|
$db_query = "INSERT INTO combo(combono, part, partid, comboitem,detail, enable,creater, create_at) VALUES ('$combono', '$part', '$partid', '$comboitem','$detail', '$enable','$creater', '$create_at')";
|
|
$result = mysqli_query($link,$db_query);
|
|
$affected = mysqli_affected_rows($link);
|
|
mysqli_close($link);
|
|
if ($affected > 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('新增成功');";
|
|
echo "location.href='combo-index.php?function_name=combo&".$token_link."';";
|
|
echo "</script>";
|
|
} elseif ($affected == 0) {
|
|
echo "<script type ='text/JavaScript'>";
|
|
echo "alert('無新增資料');";
|
|
echo "location.href='combo-index.php?function_name=combo&".$token_link."';";
|
|
echo "</script>";
|
|
} else {
|
|
echo "{$db_query} 語法執行失敗,錯誤訊息SSS: " . mysqli_error($link);
|
|
}
|
|
}
|
|
?>
|
|
|