Insert Error Logs on registration failures to a table in PHP

I am modifying a system, where I need to add error log on registration failures when existing e-mail found, existing National Identity card(NIC) found and in captcha failures. To insert error log records, going to use the table z_error_log. I think this need to be done in the “else” part of the Vendor_cont.php file. Currently this provides an error messgae if an existing e-mail is used. I need to send that error log to the db. This is the code and I really appreciate your help as I am getting stuck on this point. Thanks in advance.

=====Vendor_cont.php file=======

public function register_vendor(){

        //require('recaptcha-master/src/autoload.php');

        if (!empty($_POST['register'] ))
        {

            $business_type=$this->CModel->filter_input($_POST['business_type']);
            $business_name=$this->CModel->filter_input($_POST['business_name']);
            $street=$this->CModel->filter_input($_POST['street']);
            $street_line2=$this->CModel->filter_input($_POST['street_line2']);
            $city=$this->CModel->filter_input($_POST['city']);

            $state=$this->CModel->filter_input($_POST['state']);
            $country=$this->CModel->filter_input($_POST['country']);
            $phone=$this->CModel->filter_input($_POST['phone']);
            $email=$this->CModel->filter_input($_POST['email']);
            $nic=$this->CModel->filter_input($_POST['nic']);
            $website=$this->CModel->filter_input($_POST['website']);
            $business_reg_no=$this->CModel->filter_input($_POST['business_reg_no']);

            $business_reg_authority=$this->CModel->filter_input($_POST['business_reg_authority']);

            $value_of_proc_of_interest_rad=$_POST['val_of_bsns_interest'];
            switch ($value_of_proc_of_interest_rad) {
                case '1':
                    $value_of_proc_of_interest=$this->CModel->parseToNumber($_POST['val_of_bsns_1']);
                    break;
                case '2':
                    $value_of_proc_of_interest=$this->CModel->parseToNumber($_POST['val_of_bsns_1_1']).'-'.$this->CModel->parseToNumber($_POST['val_of_bsns_1_2']);
                    break;
                case '3':
                    $value_of_proc_of_interest=$this->CModel->parseToNumber($_POST['val_of_bsns_3']);
                    break;
                default:
                    $value_of_proc_of_interest=$this->CModel->parseToNumber($_POST['val_of_bsns_1']);
            }

            $nature_of_the_bsns=$_POST['nature_of_the_bsns'];

            //$password_row=substr(str_shuffle(MD5(microtime())), 0, 10);
            $password_row= $this->CModel->randomPassword();  // 12345678;
            $password= password_hash($password_row, PASSWORD_BCRYPT, array('cost'=>10));

            if (isset($_POST['g-recaptcha-response'])) // validate
            {

                $captcha = $_POST['g-recaptcha-response'];
                $secretKey = "6Lde3mwUAAAAACFpPEDmddGyOTqhGTnowwz5hmRE";
                $ip = $_SERVER['REMOTE_ADDR'];
                $url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) .  '&response=' . urlencode($captcha);

                $response = file_get_contents($url);
                $responseKeys = json_decode($response,true);

                if($responseKeys['success']){
                    if(EMPTY( $checked_nic= $this->CModel->check_email($email) )){
                        if(EMPTY( $this->CModel->check_nic($nic) )){
                            $userData = array(
                                'user_role'=>'2',
                                'email' => $email,
                                'nic' => $nic,
                                'password' =>$password,
                                'payment' =>0,
                                'reg_date' =>date('Y-m-d H:i:s')
                            );

                            if ($inserted_user_id= $this->CModel->add_payment_user($userData)){

                                $this->LModel->createLog( $inserted_user_id,$inserted_user_id,'Vendor_cont/register_vendor- add main user',$userData,$_SERVER['PHP_SELF']); //create log

                                $number_type = 'V';
                                $group_label = 'VENDOR';

                                $autoNumberData = array(
                                    'number_type' => $number_type,
                                    'group_label' => $group_label
                                );

                                if ($inserted_auto_number_id = $this->CModel->add_auto_number($autoNumberData)) {

                                    $this->LModel->createLog($inserted_auto_number_id, $inserted_auto_number_id, 'Vendor_cont/register_vendor- add auto number', $autoNumberData, $_SERVER['PHP_SELF']); //create log

                                    while (strlen($inserted_auto_number_id) < 6) {
                                        $inserted_auto_number_id = "0" . $inserted_auto_number_id;
                                    }

                                    $registration_no = $number_type . $inserted_auto_number_id;

                                $venData = array(
                                    'user_id'=>$inserted_user_id,
                                    'registration_no' => $registration_no,
                                    'business_type'=>$business_type,
                                    'business_name'=>$business_name,
                                    'street' => $street,
                                    'street_line2' => $street_line2,
                                    'city' => $city,
                                    'state' => $state,
                                    'country' => $country,
                                    'phone' => $phone,
                                    'website' => $website,
                                    'business_reg_no' => $business_reg_no,
                                    'business_reg_authority' => $business_reg_authority,
                                    'value_of_proc_of_interest_rad_value' => $value_of_proc_of_interest_rad,
                                    'value_of_proc_of_interest' => $value_of_proc_of_interest
                                );

                                if ($inserted_id= $this->VModel->add_ven($venData)){

                                    $this->LModel->createLog( $inserted_id,$inserted_user_id,'Vendor_cont/register_vendor- add vendor',$venData,$_SERVER['PHP_SELF']); //create log

                                    //add vendor_nature_of_bsns
                                    foreach($nature_of_the_bsns as $nb){
                                        $aData = array(
                                            'user_id' =>$inserted_user_id,
                                            'nature_of_bsns_id' => $nb
                                        );
                                        $inserted_V=$this->VModel->add_vendor_nature_of_the_bsns($aData);
                                        $this->LModel->createLog( $inserted_V,$inserted_user_id,'Vendor_cont/register_vendor- add_vendor_nature_of_the_bsns',$aData,$_SERVER['PHP_SELF']); //create log
                                    }

                                    if(isset($_POST['dist_arr'])){
                                        $interested_bsns_areas_dists=$_POST['dist_arr'];
                                        $array_dist = explode(',', $interested_bsns_areas_dists);
                                        if($interested_bsns_areas_dists !=''){
                                            //save all districts
                                            foreach($array_dist as $ibad){
                                                $aData = array(
                                                    'user_id' =>$inserted_user_id,
                                                    'district_city_id' => $ibad,
                                                    'flag1'=>1
                                                );
                                                $inserted_V=$this->VModel->add_vendor_interested_bsns_areas($aData);
                                                $this->LModel->createLog( $inserted_V,$inserted_user_id,'Vendor_cont/register_vendor/add_vendor_interested_bsns_areas',$aData,$_SERVER['PHP_SELF']); //create log
                                            }
                                        }
                                    }

                                    if(isset($_POST['city_arr'])){
                                        $interested_bsns_areas_cities=$_POST['city_arr'];
                                        $array_city = explode(',', $interested_bsns_areas_cities);
                                        if($interested_bsns_areas_cities !=''){
                                            foreach($array_city as $ibad){
                                                $aData = array(
                                                    'user_id' =>$inserted_user_id,
                                                    'district_city_id' => $ibad,
                                                    'flag1'=>2
                                                );
                                                //check whether this city's distrcit has saved. if it is skip that city. else save
                                                $checked_state= $this->CModel->check_cities_district_saved($ibad,$inserted_user_id);

                                                if($checked_state){
                                                    $inserted_V=$this->VModel->add_vendor_interested_bsns_areas($aData);
                                                    $this->LModel->createLog( $inserted_V,$inserted_user_id,'Vendor_cont/register_vendor/add_vendor_interested_bsns_areas',$aData,$_SERVER['PHP_SELF']); //create log
                                                }
                                            }
                                        }

                                    }

                                    //upload documents
                                    $upload_path='uploads/vendor_documents/';
                                    // Count total files
                                    $countfiles = count($_FILES['file_input']['name']);
                                    // Looping all files
                                    for($i=0;$i<$countfiles;$i++){
                                        //$filename = $_FILES['file']['name'][$i];
                                        $temp = explode(".", $_FILES["file_input"]["name"][$i]);
                                        $newfilename = uniqid().round(microtime(true)) . '.' . end($temp);

                                        move_uploaded_file($_FILES['file_input']['tmp_name'][$i],$upload_path.$newfilename);

                                        //insert in to the table
                                        $aData = array(
                                            'related_id' =>$inserted_user_id,
                                            'name' => $upload_path.$newfilename ,
                                            'doc_type_main'=>1,
                                            'doc_name'=>$this->CModel->filter_input($_POST["file_name"][$i])
                                        );
                                        $inserted_doc_id=$this->CModel->insert_document($aData);
                                        $this->LModel->createLog( $inserted_doc_id,$inserted_user_id,'Vendor_cont/register_vendor-insert_document',$aData,$_SERVER['PHP_SELF']); //create log
                                    }

                                    //$this->LModel->createLog( $inserted_id,$inserted_user_id,'Vendor_cont/register_vendor-POST',$_POST,$_SERVER['PHP_SELF']); //create log

//                                    $_SESSION['Smessages'] = '<h3> Thank you very much for registration as a Vendors with  System . Please check your email given in your application for official acknowledgement and password generated by the  system.
//                                      You may please login to the System using the password input the information requested.
//                                       ! </h3>';

                                    //send mail that use login to pay
                                    $mail_sub='Temporary Login Details ';

                                    $mail_body=" "; //content of the body

                                    if( $this->mailModel->send_mail($email,$mail_sub,$mail_body)){
                                        $status=1;
                                    }else{
                                        $status=0;
                                    }
                                    $this->LModel->mail_log($inserted_user_id, $mail_body,"User Password",__METHOD__,$status,$email); //create log

                                    $_SESSION['Smessages'] = 'Registration Success. Pay the Registration fee to continue';

                                    header("Location:".ROOT_URL."?p=payment_cont&a=vendor_reg_fee&id=".$this->CModel->encode($inserted_user_id));
                                    die();

                                } else{
                                    $_SESSION['Emessages'] = 'An error has occurred! Please try again later.'; //set Error message
                                }
                                } else {
                                    $_SESSION['Emessages'] = 'An error has occurred! Please try again later.'; //set Error message
                                }

                            }else{
                                $_SESSION['Emessages'] = 'An error has occurred during user registration! Please try again later.'; //set Error message
                            }
                        }

                    }else{
                        //check whether paid fee or not
                        $paid= $this->UserModel->get_user_data($checked_nic->user_id);
                        if($paid->payment =='0'){
                            //didnt pay.
                            $_SESSION['Smessages'] = 'Registration Success. Pay the Registration fee to continue';
                            header("Location:".ROOT_URL."?p=payment_cont&a=vendor_reg_fee&id=".$this->CModel->encode($checked_nic->user_id));
                        }

                        if($paid->confirmed =='0' && $paid->payment =='1'){
                            //didnt pay.
                            $_SESSION['Emessages'] = 'Your information has been received.   
                           e-Gp system administrator will check your registration documents and will send you a new login credentials to your given email.';
                        }

                        if(($paid->confirmed =='1' && $paid->payment =='1') || $paid->payment =='2'){
                            //didnt pay.
                            $_SESSION['Emessages'] = ' Given E-mail already exists in the System. ';
                        }

                    }
                } else {
                     $_SESSION['Emessages'] = 'Recaptcha Failed. Please try again later';
                    // $this->LModel->createErrorLog(0,'Vendor_cont/register_vendor/recaptcha_fail',$responseKeys['success'],$_POST); //create log
                }
            }else{
                $_SESSION['Emessages'] = 'Captcha Required';
            }
        }

        $this->oUtil->business_type=$this->CModel->getData('z_vendor_bsns_type','1=1','name');
        $this->oUtil->business_reg_au=$this->CModel->getData('z_business_reg_au','1=1','name');
        $this->oUtil->nature_of_the_bsns=$this->CModel->getData('z_nature_of_the_business','1=1','name');
        $this->oUtil->interested_bsns_areas=$this->CModel->getData('z_districts','1=1','name_en');

        $this->oUtil->cities=$this->CModel->getData('z_cities','1=1','name_en');
        $this->oUtil->provinces=$this->CModel->getData('z_provinces','1=1','name_en');
        $this->oUtil->countries=$this->CModel->getData('z_countries','1=1','country_name');

        $this->oUtil->form_type='insert';

        $max_file_size_data=$this->CModel->get_variable_value('validation_file_size');
        $this->oUtil->max_file_size=$max_file_size_data->value;

        $this->oUtil->getView('vendor/frm_register_vendor');
    } 

========Log_model.php============

public function createErrorLog($user,$function,$error_data,$data){

        $ip=$_SERVER['REMOTE_ADDR'];
        $browser_os=  $_SERVER['HTTP_USER_AGENT'];
    $data= (array) $data_obj;

    //print_r($data);

    if (is_array($data)) {
        $val = '(' . implode(',', array_keys($data)) . ')';
        $val .= '=(' . implode(',', $data) . ')';
    } else {
        $val = $data;
    }

    $oStmt= $this->oDb->prepare('INSERT INTO z_error_log (`row_id`,`user`,`ip`,`page`,`function`,`data`,`browser_os`) VALUES (:row_id,:user,:ip,:page,:function,:data,:browser_os)');
    $oStmt->bindParam(':row_id', $row_id, \PDO::PARAM_INT);
    $oStmt->bindParam(':user', $user, \PDO::PARAM_INT);
    $oStmt->bindParam(':ip', $ip, \PDO::PARAM_STR);
    $oStmt->bindParam(':page', $page1, \PDO::PARAM_STR);
    $oStmt->bindParam(':function', $page_url, \PDO::PARAM_STR);
    $oStmt->bindParam(':data', $val, \PDO::PARAM_STR);
    $oStmt->bindParam(':browser_os', $browser_os, \PDO::PARAM_STR);
    $oStmt->execute();

    return  $this->oDb->lastInsertId();
}

So where are you stumped?

@astonecipher, I want to add the error log to the z_error_log table when an existing e-mail or NIC found. I have no idea of how to do that or where to insert taht code. Please help me. Thanks alot

So do the same thing you are doing on successful login,

$this->LModel->createLog

@astonecipher, did you mean to add this code to the else part? Please help me to clear this. (I modified an existing project, so i cannot understand some points clearly, so I appreciate your guidance)

$this->LModel->createLog( $inserted_id,$inserted_user_id,‘Vendor_cont/register_vendor-POST’,$_POST,$_SERVER[‘PHP_SELF’]);

You don’t even need to add it to the else and can remove it from the if statement. Just add the messages you want to be logged, since you are logging both good and bad logins, and have the logging below all of the logical flows. The only thing that will change is what is logged, not if it will be logged.

@astonecipher, I added two lines with comment //ADDED CODE to the else part of the recaptch failed. Can you please tell me adding which line is correct. (I mean the first commented line or second one) I am not able to find the correct line to add, that’s why I;m asking. Sorry for my bad english too. Thanks a lot

if (isset($_POST[‘g-recaptcha-response’])) // validate
{

            $captcha = $_POST['g-recaptcha-response'];
            $secretKey = "6Lde3mwUAAAAACFpPEDmddGyOTqhGTnowwz5hmRE";
            $ip = $_SERVER['REMOTE_ADDR'];
            $url = 'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) .  '&response=' . urlencode($captcha);

            $response = file_get_contents($url);
            $responseKeys = json_decode($response,true);

            if($responseKeys['success']){
                if(EMPTY( $checked_nic= $this->CModel->check_email($email) )){
                    if(EMPTY( $this->CModel->check_nic($nic) )){
                        $userData = array(
                            'user_role'=>'2',
                            'email' => $email,
                            'nic' => $nic,
                            'password' =>$password,
                            'payment' =>0,
                            'reg_date' =>date('Y-m-d H:i:s')
                        );

                        if ($inserted_user_id= $this->CModel->add_payment_user($userData)){

                            $this->LModel->createLog( $inserted_user_id,$inserted_user_id,'Vendor_cont/register_vendor- add main user',$userData,$_SERVER['PHP_SELF']); //create log

                            $number_type = 'V';
                            $group_label = 'VENDOR';

                            $autoNumberData = array(
                                'number_type' => $number_type,
                                'group_label' => $group_label
                            );

                            if ($inserted_auto_number_id = $this->CModel->add_auto_number($autoNumberData)) {

                                $this->LModel->createLog($inserted_auto_number_id, $inserted_auto_number_id, 'Vendor_cont/register_vendor- add auto number', $autoNumberData, $_SERVER['PHP_SELF']); //create log

                                while (strlen($inserted_auto_number_id) < 6) {
                                    $inserted_auto_number_id = "0" . $inserted_auto_number_id;
                                }

                                $registration_no = $number_type . $inserted_auto_number_id;

                            $venData = array(
                                'user_id'=>$inserted_user_id,
                                'registration_no' => $registration_no,
                                'business_type'=>$business_type,
                                'business_name'=>$business_name,
                                'street' => $street,
                                'street_line2' => $street_line2,
                                'city' => $city,
                                'state' => $state,
                                'country' => $country,
                                'phone' => $phone,
                                'website' => $website,
                                'business_reg_no' => $business_reg_no,
                                'business_reg_authority' => $business_reg_authority,
                                'value_of_proc_of_interest_rad_value' => $value_of_proc_of_interest_rad,
                                'value_of_proc_of_interest' => $value_of_proc_of_interest
                            );

                            if ($inserted_id= $this->VModel->add_ven($venData)){

                                $this->LModel->createLog( $inserted_id,$inserted_user_id,'Vendor_cont/register_vendor- add vendor',$venData,$_SERVER['PHP_SELF']); //create log

                                //add vendor_nature_of_bsns
                                foreach($nature_of_the_bsns as $nb){
                                    $aData = array(
                                        'user_id' =>$inserted_user_id,
                                        'nature_of_bsns_id' => $nb
                                    );
                                    $inserted_V=$this->VModel->add_vendor_nature_of_the_bsns($aData);
                                    $this->LModel->createLog( $inserted_V,$inserted_user_id,'Vendor_cont/register_vendor- add_vendor_nature_of_the_bsns',$aData,$_SERVER['PHP_SELF']); //create log
                                }

                                if(isset($_POST['dist_arr'])){
                                    $interested_bsns_areas_dists=$_POST['dist_arr'];
                                    $array_dist = explode(',', $interested_bsns_areas_dists);
                                    if($interested_bsns_areas_dists !=''){
                                        //save all districts
                                        foreach($array_dist as $ibad){
                                            $aData = array(
                                                'user_id' =>$inserted_user_id,
                                                'district_city_id' => $ibad,
                                                'flag1'=>1
                                            );
                                            $inserted_V=$this->VModel->add_vendor_interested_bsns_areas($aData);
                                            $this->LModel->createLog( $inserted_V,$inserted_user_id,'Vendor_cont/register_vendor/add_vendor_interested_bsns_areas',$aData,$_SERVER['PHP_SELF']); //create log
                                        }
                                    }
                                }

                                if(isset($_POST['city_arr'])){
                                    $interested_bsns_areas_cities=$_POST['city_arr'];
                                    $array_city = explode(',', $interested_bsns_areas_cities);
                                    if($interested_bsns_areas_cities !=''){
                                        foreach($array_city as $ibad){
                                            $aData = array(
                                                'user_id' =>$inserted_user_id,
                                                'district_city_id' => $ibad,
                                                'flag1'=>2
                                            );
                                            //check whether this city's distrcit has saved. if it is skip that city. else save
                                            $checked_state= $this->CModel->check_cities_district_saved($ibad,$inserted_user_id);

                                            if($checked_state){
                                                $inserted_V=$this->VModel->add_vendor_interested_bsns_areas($aData);
                                                $this->LModel->createLog( $inserted_V,$inserted_user_id,'Vendor_cont/register_vendor/add_vendor_interested_bsns_areas',$aData,$_SERVER['PHP_SELF']); //create log
                                            }
                                        }
                                    }

                                }

                                //upload documents
                                $upload_path='uploads/vendor_documents/';
                                // Count total files
                                $countfiles = count($_FILES['file_input']['name']);
                                // Looping all files
                                for($i=0;$i<$countfiles;$i++){
                                    //$filename = $_FILES['file']['name'][$i];
                                    $temp = explode(".", $_FILES["file_input"]["name"][$i]);
                                    $newfilename = uniqid().round(microtime(true)) . '.' . end($temp);

                                    move_uploaded_file($_FILES['file_input']['tmp_name'][$i],$upload_path.$newfilename);

                                    //insert in to the table
                                    $aData = array(
                                        'related_id' =>$inserted_user_id,
                                        'name' => $upload_path.$newfilename ,
                                        'doc_type_main'=>1,
                                        'doc_name'=>$this->CModel->filter_input($_POST["file_name"][$i])
                                    );
                                    $inserted_doc_id=$this->CModel->insert_document($aData);
                                    $this->LModel->createLog( $inserted_doc_id,$inserted_user_id,'Vendor_cont/register_vendor-insert_document',$aData,$_SERVER['PHP_SELF']); //create log
                                }

                                //$this->LModel->createLog( $inserted_id,$inserted_user_id,'Vendor_cont/register_vendor-POST',$_POST,$_SERVER['PHP_SELF']); //create log

// $_SESSION[‘Smessages’] = ’

Thank you very much for registration as a Vendors with System . Please check your email given in your application for official acknowledgement and password generated by the system.
// You may please login to the System using the password input the information requested.
// !

';
                                //send mail that use login to pay
                                $mail_sub='Temporary Login Details ';

                                $mail_body=" "; //content of the body

                                if( $this->mailModel->send_mail($email,$mail_sub,$mail_body)){
                                    $status=1;
                                }else{
                                    $status=0;
                                }
                                $this->LModel->mail_log($inserted_user_id, $mail_body,"User Password",__METHOD__,$status,$email); //create log

                                $_SESSION['Smessages'] = 'Registration Success. Pay the Registration fee to continue';

                                header("Location:".ROOT_URL."?p=payment_cont&a=vendor_reg_fee&id=".$this->CModel->encode($inserted_user_id));
                                die();

                            } else{
                                $_SESSION['Emessages'] = 'An error has occurred! Please try again later.'; //set Error message
                            }
                            } else {
                                $_SESSION['Emessages'] = 'An error has occurred! Please try again later.'; //set Error message
                            }

                        }else{
                            $_SESSION['Emessages'] = 'An error has occurred during user registration! Please try again later.'; //set Error message
                        }
                    }

                }else{
                    //check whether paid fee or not
                    $paid= $this->UserModel->get_user_data($checked_nic->user_id);
                    if($paid->payment =='0'){
                        //didnt pay.
                        $_SESSION['Smessages'] = 'Registration Success. Pay the Registration fee to continue';
                        header("Location:".ROOT_URL."?p=payment_cont&a=vendor_reg_fee&id=".$this->CModel->encode($checked_nic->user_id));
                    }

                    if($paid->confirmed =='0' && $paid->payment =='1'){
                        //didnt pay.
                        $_SESSION['Emessages'] = 'Your information has been received.   
                       e-Gp system administrator will check your registration documents and will send you a new login credentials to your given email.';
                    }

                    if(($paid->confirmed =='1' && $paid->payment =='1') || $paid->payment =='2'){
                        //didnt pay.
                        $_SESSION['Emessages'] = ' Given E-mail already exists in the System. ';
                    }

                }
            } else {
                 $_SESSION['Emessages'] = 'Recaptcha Failed. Please try again later';

//ADDED CODE
// $this->LModel->createErrorLog(0,‘Vendor_cont/register_vendor/recaptcha_fail’,$responseKeys[‘success’],$_POST);
//$this->LModel->createErrorLog( $inserted_id,$inserted_user_id,‘Vendor_cont/register_vendor-POST’,$_POST,$_SERVER[‘PHP_SELF’]);

//create log
}
}else{
$_SESSION[‘Emessages’] = ‘Captcha Required’;
}
}

You skipped over the whole, add it to the end huh?

// $this->LModel->createErrorLog(0,‘Vendor_cont/register_vendor/recaptcha_fail’,$responseKeys[‘success’],$_POST);

This is closer to what you want, but you need to add a message stating that it is an bad login. $responseKeys[‘success’] is just going to be false.

@astonecipher, As I am not able to clearly understand this code(because I am editing an existing project) I think to add this code to the else part as I mentioned in my previous answer. I add false to the $responseKeys[‘false’].
And I think to add this line of code to the else part because there is an error message saying recaptch failed.
$_SESSION[‘Emessages’] = ‘Recaptcha Failed. Please try again later’;

And also, I am not sure which line of code to add. Which line of code, I mean ADDED CODE line 1 or ADDED CODE line 2 need to add in order to insert error data to the table. I add both lines. If I add this line of code to the else part, is it enough to send those error data into the table or do I need to edit more on this code?

Please help me.

Thanks a lot

 if(($paid->confirmed =='1' && $paid->payment =='1') || $paid->payment =='2'){
                        //didnt pay.
                        $_SESSION['Emessages'] = ' Given E-mail already exists in the System. ';
                    }

                }
            } else {
                 $_SESSION['Emessages'] = 'Recaptcha Failed. Please try again later';
//ADDED CODE line 1
// $this->LModel->createErrorLog(0,‘Vendor_cont/register_vendor/recaptcha_fail’,$responseKeys[‘false’],$_POST);

//ADDED CODE line 2
//$this->LModel->createErrorLog( $inserted_id,$inserted_user_id,‘Vendor_cont/register_vendor-POST’,$_POST,$_SERVER[‘PHP_SELF’]);

//create log
}
}else{
$_SESSION[‘Emessages’] = ‘Captcha Required’;
}
}
Sponsor our Newsletter | Privacy Policy | Terms of Service