<?php header("Content-Type:text/html;charset=UTF-8"); session_start(); include "db.php"; include "function/new_function.php"; $admuser = trim($_POST['admuser']); $userpass = trim($_POST['userpass']); $check = $_POST['check']; $s_check = $_SESSION['check']; $guard = new guard(); $tool = new My_Tool(); if (strcmp($check, $s_check) != 0) { $tool->error("驗證碼錯誤!"); } if (empty($admuser) or empty($userpass)) { echo "<script>"; echo "alert(\"帳號密碼欄位不可空白!\");"; echo "location.href = \"login.php\";"; echo "</script>"; exit; } // 檢查登入名稱及等級 BEGIN $qrystr = "SELECT * FROM member WHERE m_username ='******' "; $res = mysql_query($qrystr); // 檢查登入名稱及等級 END if (mysql_num_rows($res) > 0) { $row = mysql_fetch_array($res); if ($userpass == $row['m_userpass']) { session_start(); // 將 admuser 變數註冊成為 session
<?php if ($_POST['submit']) { $unit = new product_class(); $tool = new My_Tool(); $sam = new guard(); //檢查傳入值-------------------------- $name = htmlspecialchars(trim($_POST['name'])); if (empty($name)) { $tool->error(get_msg("name_error")); } else { $name = $sam->var_check($name); } $unit->table = $pro_class_table; $unit->get_vars(); $buff = array(); $unit->get_history($unit->upid, $buff); $unit->add(); $tool->show(get_msg("add_success"), $_SERVER['HTTP_REFERER']); exit; } ?> <form method="post" action=""> <input type="hidden" name="upid" value="<?php print $_GET['id']; ?> " /> 類別名稱:<input type="text" name="name" size="20" /> 排序: <input type="text" name="no" value="100" /> <input type="submit" name="submit" value="新增類別" />
//宣告tool物件 $tool = new My_Tool(); $sam = new guard(); $unit = new product(); $unit->table = $product_table; //設定資料表 //宣告完畢 //取得需檢查的資料----------------------- $id = $_POST['id']; $upid = $_POST['upid']; $check = $_POST['check']; //取得完畢--------------------------- //開始檢查--------------------------- if ($pro_class_set == 1) { if (empty($upid) and ($check == "add" or $check == "upd")) { $tool->error("未選擇類別!"); } } if (empty($id) and $check != "add") { $tool->error("參數錯誤,未指定產品!"); } if ($_FILES['upload']['size'] != 0 and !$sam->image_check($_FILES['upload']['type'], $pic_jpg, $pic_gif, $pic_png)) { $tool->error("圖片檔案格式有誤!"); } if ($_FILES['upload']['size'] > $pic_max_size) { $tool->error("檔案大小超過限制!"); } //檢查完畢--------------------------- //處理圖檔上傳--------------------------- if ($_FILES['upload']['size'] > 0) { $img = new img_uploader();
include "../system.php"; //程式個別設定 include "../class_unit.php"; //分類unit include "../product_unit.php"; //分類unit include "../../gd.php"; $tool = new My_Tool(); $sam = new guard(); $unit = new product_class(); $unit2 = new product(); $check = $_POST['check']; //處理圖檔上傳--------------------------- if ($_FILES['upload']['size'] > 0) { if (!$sam->image_check($_FILES['upload']['type'], $pic_jpg, $pic_gif, $pic_png)) { $tool->error("圖片檔案格式有誤!"); } $img = new img_uploader(); $img->set_path($_FILES['upload']); //置入路徑 $img->set_width($pic_width); //決定縮圖大小,大圖大小 $img->set_savepath("../images/" . date("Y-m-d")); //設定儲存路徑 $pic = $img->save(); } else { $pic = $_POST['pic']; } if ($_FILES['upload2']['size'] > 0) { if (!$sam->image_check($_FILES['upload2']['type'], $pic_jpg, $pic_gif, $pic_png)) { $tool->error("圖片檔案格式有誤!");
$tool = new My_Tool(); $unit = new download(); $id = $_GET['id']; //System----------------------------------------------------------- $now_table = $pro_download_table; //System----------------------------------------------------------- //Images UPLOAD------------------------------------------------------------ if (!empty($_POST['Goupload'])) { //若有點選上傳 $upid = $_POST['upid']; if ($_FILES['file']['size'] > 0) { $sql = "select count(*) as total from `{$now_table}` where upid='{$upid}'"; $res = mysql_query($sql); $row = mysql_fetch_array($res); if ($row['total'] >= $pro_download_num) { $tool->error('檔案上傳已達上限!'); } //檢查檔案類型 $type = array("application/pdf", "application/msword"); //, "application/octet-stream", "application/x-msdownload", "application/vnd.ms-excel"); $upload = new file_uploader(); $upload->allow_type = $type; //允許上傳檔案類型 $upload->allow_size = 1024 * 1024 * 10; //大小限制 10mb $upload->save_path = "../../images/file/" . date("Y-m-d"); //儲存的資料夾路徑 $file = $upload->save($_FILES['file']); if ($file === false) { $tool->error("檔案上傳失敗!!"); }
// 外掛 session 檢查功能 include "../../system.php"; include "../../gd.php"; include "../../function/new_function.php"; //引入函數.資料庫檔 include "../system.php"; //System-------------------------------------------------------------------- $now_table = $pro_sys_table; //System-------------------------------------------------------------------- //更新資料BEGIN-------------------------------------------------------------- if (isset($_POST['submit'])) { $tool = new My_Tool(); $sam = new guard(); //數值區檢查-------------------------------- if ($_POST['pic_quality'] <= 0) { $tool->error("圖片品質不可為0或小於0!"); } if ($_POST['pic_width'] <= 0 or $_POST['pic_width_small'] <= 0) { $tool->error("圖片上傳寬度不可為0或小於0!"); } if ($_POST['pic_max_size'] <= 0) { $tool->error("圖片檔案大小限制不可為0或小於0!"); } if ($_POST['pic_bg_w'] <= 0) { $tool->error("圖片外框寬度不可為0或小於0!"); } if ($_POST['pic_bg_h'] <= 0) { $tool->error("圖片外框高度不可為0或小於0!"); } if ($_POST['pic_jpg'] == 0 and $_POST['pic_gif'] == 0 and $_POST['pic_png'] == 0) { $tool->error("圖片檔案種類至少要勾選一個!");