/var/www/hkosl.com/sinomax/survey/registration_step1_verify_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
<?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(
$_SESSION["telephone"]) || empty($_SESSION["telephone"])){
        echo 
"<script>alert('Please enter your mobile number.\\n請輸入你的手提電話號碼。'); history.back(); </script>";
        exit;
    }else{
        if((int)
$_SESSION["telephone"] != $_SESSION["telephone"]) {
            echo 
"<script>alert('Please enter correct mobile number.\\n請輸入正確的手提電話號碼。'); history.back(); </script>";
            exit;
        }
    }

    if(empty(
$_POST["code"])){
        echo 
"<script>alert('Please enter sms verification code.\\n請輸入認證碼。'); history.back(); </script>";
        exit;
    }

    
$tel $_SESSION["telephone"];
    
$code $_POST["code"];

    
//send sms
    
$url      $site_info["skytree_api_hostname"].'api/vip/verifyTel?tel='.$tel.'&code='.$code;
    
$result call_curl($urlNULL0);
    
$result_array json_decode($resulttrue);

    if(
$result_array["error"] == "0"){
        
$_SESSION["account_verified"] = 1;

        
//echo "<script>alert('Your phone number is verified. Please continue and complete the registration process.\\n你的流動電話號碼已成功認證。請繼續註冊流程。'); window.location.href='registration_step2.php?id=".$id."'; </script>";
        
echo "<script>window.location.href='registration_step2.php?id=".$id."'; </script>";
    }else{
        echo 
"<script>alert('Wrong verification code. Please enter again.\\n認證錯誤,請再嘗試。'); history.back(); </script>";
    }