/var/www/hkosl.com/sinomax/survey/registration_step1_post.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
70
71
72
73
74
75
76
<?php
    
require_once('webadmin/basic_info.php');

    
$id       = (int)$_SESSION["id"];
    
$campaign get_campaign($id1);

    if (!isset(
$_SESSION["id"]) || (int)$_SESSION["id"] <= || empty($campaign)) {
        
missing_campaign_id();
    }
?>
    <!DOCTYPE html>
    <html>
    <head>
        <?php require_once('html_head.php'); ?>
    </head>
    <body>

    <div class="container" style="border: none;"></div>

    <?php require_once('html_footer.php'); ?>
    </body>
    </html>

<?php
    check_campaign_date
($campaign);

    if (!isset(
$_REQUEST["telephone"]) || empty($_REQUEST["telephone"])) {
        echo 
"<script>alert('Please enter your mobile number.\\n請輸入你的手提電話號碼。'); history.back(); </script>";
        exit;
    } else {
        if (!
is_numeric($_REQUEST["telephone"]) || (int)$_REQUEST["telephone"] <= 0) {
            echo 
"<script>alert('Please enter correct mobile number.\\n請輸入正確的手提電話號碼。'); history.back(); </script>";
            exit;
        }

        if (
$_REQUEST["telephone"][0] != "5" && $_REQUEST["telephone"][0] != "6" && $_REQUEST["telephone"][0] != "9") {
            echo 
"<script>alert('Please enter correct mobile number. \\n請輸入正確的流動電話。\\n\\n'); history.back(); </script>";
            exit;
        }

        if (
strlen($_REQUEST["telephone"]) != 8) {
            echo 
"<script>alert('Mobile number should be 8 digital number. \\n流動電話應是由8個數字組成。\\n\\n'); history.back(); </script>";
            exit;
        }
    }

    
$tel = (int)$_REQUEST["telephone"];

    
$_SESSION["telephone"] = $tel;

    
//send sms
    
$url    $site_info["skytree_api_hostname"] . 'api/vip/requestSMSVerification?tel=' $tel;
    
$result call_curl($urlNULL0);

    
$result_array json_decode($resulttrue);

    
//if (true) {
    
if ($result_array["error"] == "0") {
        
/*if (isset($_SESSION["telephone"])) {
            echo "<script>location.href='registration_step1_verify.php?resend=1'; </script>";
        } else {
            $_SESSION["telephone"] = $tel;*/

        
echo "<script>alert('A verification code will be sent to your mobile in a few minutes. Please wait and enter the code for account activation later.\\n閣下將於數分鐘內收到認證短訊,請稍後並輸入驗證碼以啟動戶口。'); location.href='registration_step1_verify.php?telephone=" $_SESSION["telephone"] . "&send=1'; </script>";
        exit;
        
//}

    
} else {
        if (
$result_array["errMsg"] == "vipAccountAlreadyExists") {
            echo 
"<script>alert('This mobile number has been registered as VIP before. Please use another mobile number for registration.\\n閣下所輸入之電話號碼已被登記為會員。請以其他電話號碼繼續登記。'); history.back(); </script>";
            exit;
        } else {
            echo 
"<script>alert('The verification sms message cannot send out. Please try again.\\n認證短訊未能送出,請重新嘗試。'); history.back(); </script>";
            exit;
        }
    }