<?php

if (!$_SESSION) {
    session_start();
}
// ini_set('default_charset', 'utf-8');
//--- 讀入基本設定
include "function/function.php";
require 'libs/Smarty.class.php';
include "base_config.php";
// include ADMINROOT."/getfile.php";
$msql = new phpMysql_h();
$tool = new tools_h();
$sql = "SELECT id FROM `wwd_application_speedmatch` WHERE applyid='" . $aid . "' AND cateid='" . $cateid . "' ";
// echo "<br>sql=".$sql; exit;
$msql->init();
$msql->query($sql);
if (list($id) = mysql_fetch_row($msql->listmysql)) {
    $tool->showmessage("此需求單已送過快速服務申請,請勿重複操作或聯繫客服人員確認!");
    $tool->goURL2("parent", "member_client_myneeds01.php");
    exit;
}
$hash = uniqid(mt_srand((double) microtime() * 1000000));
$sql = "INSERT INTO `wwd_application_speedmatch` (`hash`,`cateid` ,`applyid` ,`serial` ,`firstname` ,`sex` ,`mobile` ,`contactable` ,`office_city` ,\n\t\t`office_area` ,`isSeen` ,`SheetBuyPlace` ,`buySelf` ,`creator` ,`createdtime`) VALUES ('{$hash}', '{$cateid}',  '{$aid}',  '{$serial}',  '{$firstname}',  \n\t\t'{$sex}',  '{$mobile}',  '{$contactable}',  '{$office_city}',  '{$office_area}',  '{$isSeen}',  '{$SheetBuyPlace}',  '{$buySelf}',  '" . $_COOKIE[user_id] . "',  \n\t\tNOW());";
// error_log($sql."\r\n\r\n",3,"log_fast_do_sql.log");
$msql->init();
$msql->query($sql);
$sql2 = "SELECT id FROM `wwd_application_speedmatch` WHERE hash='" . $hash . "' ";
$msql->init();
$msql->query($sql2);
if (list($id2) = mysql_fetch_row($msql->listmysql)) {
<?php

if (!isset($_SESSION)) {
    session_start();
}
//--- 讀入基本設定
include "function/function.php";
require 'libs/Smarty.class.php';
include "base_config.php";
$msql = new phpMysql_h();
$tool = new tools_h();
//--- 所屬功能
if ($id) {
    $sqlWhere = " WHERE id=" . $id;
    $row = loaddata_row("article", $sqlWhere);
    if ($row) {
        $sql = "UPDATE `article` SET views=views+1 WHERE id=" . $row['id'];
        $msql->init();
        $msql->query($sql);
    } else {
        // echo "<script>alert('請指定菜單');</script>";
        $tool->showmessage('無此文章!');
        $tool->goBack();
        exit;
    }
} else {
    // echo "<script>alert('請指定菜單');</script>";
    $tool->showmessage('無此文章!');
    $tool->goBack();
    exit;
}
Exemple #3
0
<?php

header("Content-Type:text/html;charset=UTF-8");
include "../../function/function.php";
include "../../gd.php";
//宣告tool物件
$tool = new tools_h();
if (isset($_POST['submit'])) {
    $array = array(0 => "", 1 => "1", 2 => "2", 3 => "3", 4 => "4", 5 => "5", 6 => "6", 7 => "7", 8 => "8", 9 => "9", 10 => "10");
    //暫存檔名 0為無效
    for ($i = 1; $i <= 10; $i++) {
        if ($_FILES["pic" . $i]["size"] > 1024 * 300) {
            $tool->showmessage("檔案大小超過限制!");
            $tool->submitURL("upload.php");
            //判斷從何處進入檔案
            exit;
        } else {
            $path = "../images";
            // 檢查是否已有此使用者目錄
            if (!is_dir($path)) {
                mkdir($path, 0755);
            }
            //以上為新增目錄
            if ($_FILES["pic" . $i]["size"] > 0) {
                $t1 = $_FILES["pic" . $i]['name'];
                $ext = strrchr($t1, '.');
                //***************************圖檔格式限制Begin********************************************
                if ($_FILES["pic" . $i]['type'] != 'image/pjpeg' and $_FILES["pic" . $i]['type'] != 'image/jpeg') {
                    $checkment++;
                }
                if ($checkment == 1) {