<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
if (isset($_GET["par4"])) {
    $acc_Id = $_GET["par4"];
    $tools = new tools();
    $encstring = $tools->encrypt_decrypt('encrypt', $acc_Id);
    $successContent = '{';
    $successContent .= '"status":"Access_Granted",';
    $successContent .= '"activationKey":"' . $encstring . '"';
    $successContent .= '}';
    echo $successContent;
}
<?php

if (isset($_GET["par4"])) {
    $encAccId = $_GET["par4"];
    $tools = new tools();
    $acc_Id = $tools->encrypt_decrypt('decrypt', $encAccId);
    if (strlen($acc_Id) > 0) {
        $user_accounts = new user_accounts();
        $setArray = array();
        $setArray["act"] = "1";
        $conditionArray = array();
        $conditionArray["acc_Id"] = $acc_Id;
        $user_accounts->updateuser_accountsData($setArray, $conditionArray);
        $successContent = '{';
        $successContent .= '"status":"Access_Granted",';
        $successContent .= '"description":"Account Activated Successfully"';
        $successContent .= '}';
        echo $successContent;
    } else {
        $errContent = '{';
        $errContent .= '"status":"Access_Denied",';
        $errContent .= '"description":"Sorry, your account is not found"';
        $errContent .= '}';
        echo $errContent;
    }
}