/var/www/hkosl.com/thebh/20161004/include/application.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
    
require_once '../webadmin/configure.php';


    
$slideid $_GET["id"];
    
//$page = $_GET["page"];

    
$date $_POST["txtDate"];
    
$name $_POST["txtName"];
    
$email $_POST["txtEmail"];
    
$tel $_POST["txtTel"];
    
$verify $_POST["verification"];


    
$message "";
    if (
trim($date) == "")
        
$message .= "日期及時間\\r\\n";

    if (
trim($name) == "")
        
$message .= "請輸入姓名\\r\\n";

    if (
trim($email) == "")
        
$message .= "請輸入電子郵件\\r\\n";

    if (
trim($tel) == "")
        
$message .= "請輸入電話\\r\\n";

    if (
trim($verify) == "")
        
$message .= "請輸入驗證碼\\r\\n";

    if (
$message != ""){
        echo 
"<script>alert('$message'); history.back();</script>";
        exit;
    }

    
$session 'vCode'.$slideid;

    
    
$ara          explode("|"$_SESSION[$session]);
    
$verification $_POST['verification'];

    if (
$ara[0] == $verification) {

        
$userip get_client_ip();

        
$sql "insert into application (contact, email, tel, docdate, slideshow_id, createdate, deleted, lastupdate, ip_address, status) values (?,?,?,?,?,?,?,?,?,?)";

        
$parameters = array($name$email$tel$date$slideid$nowdate0$nowdate$userip1);

        
bind_pdo($sql$parameters);


    }else{
        echo 
"<script>alert('驗證碼錯誤'); history.back();</script>";
        exit;
    }
    

    
// if ($page == 'banquest_news')
    //     header("Location: ../banquet/latestnews.php?msg=1");
    // elseif ($page == 'wedding_news')
    //     header("Location: ../wedding/latestnews.php?msg=1");
    // elseif ($page == 'banquest_home')
    //     header("Location: ../banquet/index.php?msg=1");
    // elseif ($page == 'wedding_home')
    //     header("Location: ../wedding/index.php?msg=1");
    // else
    
echo "<script>alert('你的申請已成功發出'); history.back();</script>";
?>