需要帮助排除php故障(警告:缺少参数11…)

需要帮助排除php故障(警告:缺少参数11…),php,wordpress,forms,warnings,Php,Wordpress,Forms,Warnings,我不得不修改一些php代码以满足我的需要,而我的表单页面现在正在抛出这个问题 警告:缺少cash_payment()的参数11,在中调用 /…/wp content/plugins/inkAppointPro/ink admin/apt-form.php 在第66行,并在中定义 /…/wp content/plugins/inkappointmentpro/ink admin/appoints form/getway/paypal-page.php 第26行“ 提交表格时 这是有问题的两个文件。

我不得不修改一些php代码以满足我的需要,而我的表单页面现在正在抛出这个问题

警告:缺少cash_payment()的参数11,在中调用 /…/wp content/plugins/inkAppointPro/ink admin/apt-form.php 在第66行,并在中定义 /…/wp content/plugins/inkappointmentpro/ink admin/appoints form/getway/paypal-page.php 第26行“

提交表格时

这是有问题的两个文件。有人能帮忙吗?我不是一个程序员,只是一个经常在这件事上胡闹的家伙

paypal page.php

    <?php
/**
 *   Paypal Transaction 
 * @ gateway_sandbox
 * */
function gateway_sandbox() {
    if (isset($_POST['submit'])) {
        $db_obj = new Apt_DB();
        if (file_exists($db_obj->dir . "ink-admin/appointments-form/getway/paypal/paypal_sandbox.php")) {
            include_once($db_obj->dir . "ink-admin/appointments-form/getway/paypal/paypal_sandbox.php");
        }
    }
}
/**
 *   Paypal Transaction 
 * @ gateway_paypal
 * */
function gateway_paypal() {
    if (isset($_POST['submit'])) {
        $db_obj = new Apt_DB();
        if (file_exists($db_obj->dir . "ink-admin/appointments-form/getway/paypal/paypal_response.php")) {
            include_once($db_obj->dir . "ink-admin/appointments-form/getway/paypal/paypal_response.php");
        }
    }
}
function cash_payment($sr_apt_id, $sr_apt_time, $sr_apt_date, $sr_apt_persion_name, $sr_apt_email, $sr_apt_phone, $sr_msg, $sr_apt_message, $sr_apt_ugs, $sr_apt_lawnarea, $sr_data_rand) {
    global $wpdb;
    $db_obj = new Apt_DB();
    $apt_service = $db_obj->tbl_service;
    $appointment_data = $db_obj->tbl_appointment_data;
    $sql_srdata = $wpdb->get_row("SELECT * FROM $apt_service Where service_id='$sr_apt_id'", ARRAY_N);
    $cr_code = get_option('apt_currency_code');
    $price = $sql_srdata[2] . '&nbsp' . $cr_code . '&nbsp- Pay Cash Later';
    $priceshow = $sql_srdata[2] . '' . $cr_code;
    $apt_txn_booking_date = date("F j, Y, g:i A");
    $apt = new AptService();
    if (isset($_POST['submit'])) {
        $sql_val = $wpdb->get_row("SELECT * FROM $appointment_data Where apt_data_rand='$sr_data_rand'");
        if (!$sql_val) {
            $apt->insert_data_frontend($sr_apt_id, $sr_apt_date, $sr_apt_persion_name, $sql_srdata[1], $sr_apt_time, $price, $sr_apt_email, $sr_apt_phone, $sr_msg, $sr_apt_message, $sr_apt_ugs, $sr_apt_lawnarea, $sr_data_rand, $apt_txn_booking_date, 'cash');
            echo '<p>Your appointment request has be submitted successfully. We will email or phone you with confirmation.</br>Thank you for choosing Saskatoon ProLawn.</p>';
            /**
             * Send transaction notification to admin or client
             */
            $transaction_details = '';
            $personname = $sr_apt_persion_name;
            $servicename = $sql_srdata[1];
            $aptime = $sr_apt_time;
            $aptdate = $sr_apt_date;
            $aptmessage = $sr_apt_message;
            $aptugs = $sr_apt_ugs;
            $aptlawnarea =$sr_apt_lawnarea;
            $aptemail = $sr_apt_email;
            $url = site_url();
            $adminurl = str_replace('http://', '', $url);
            $transaction_details .= "Hello  $personname,\r";
            $transaction_details .= "\r";
            $transaction_details .= "Your appointment request has been received, below are the details of your request. \r \r";
            $transaction_details .= "Service Name: $servicename \r";
            $transaction_details .= "Appointment Date: $aptdate\r";
            $transaction_details .= "Appointment Time: $aptime\r";
            $transaction_details .= "Contact Phone: $aptphone\r";
            $transaction_details .= "Address: $aptmessage\r";
            $transaction_details .= "Underground Sprinklers Present: $aptugs\r";
            $transaction_details .= "Lawn Area to be Done: $aptlawnarea\r \r";
            $transaction_details .= "Thanks for choosing Saskatoon ProLawn.\r";
            $transaction_details .= "When I confirm the date and time, I will send another email or contact you at the phone number provided. Please add us \r \r";
            $transaction_details .= "Warm Regards,\r";
            $transaction_details .= "Shane\r \r";
            $transaction_details .= "$adminurl\r";
            $subject = __("Your Appointment Request Has Been Received", 'appointment');
            $filecontent = $transaction_details;
            $admin_email = get_option('admin_email');
            $headers = 'From: ' . $admin_email . ' <' . $aptemail . '>' . "\r\n" . 'Reply-To: ' . $admin_email;
            $header = 'From: ' . $aptemail . ' <' . $admin_email . '>' . "\r\n" . 'Reply-To: ' . $aptemail;
            //mail($to_admin, $subject, $filecontent, $headers);
            wp_mail($aptemail, $subject, $filecontent, $headers); //email to user
            wp_mail($admin_email, $subject, $filecontent, $header); //email to admin                                
        } //refresh value if end
    } //submit data if end
}
//function end
<?php
add_shortcode('ink-appointments-form', 'ink_appoitment');

function ink_appoitment() {
    ?>
    <script>
        jQuery.noConflict();
        jQuery(function () {
            jQuery("#aptcal").datepicker();
            jQuery("#aptcal").datepicker("option", "minDate", 0);
        });
    </script>
    <?php
    $db_obj = new Apt_DB();
    global $wpdb;
    $cpt_true = false;
    $apt_service = $db_obj->tbl_service;
    $check_apt = isset($_POST['chk_apt']) ? $_POST['chk_apt'] : null;
    $cpt_apt = isset($_POST['apt_cpt']) ? $_POST['apt_cpt'] : null;
    if ($check_apt != $cpt_apt) {
        $cpt_true = true;
    }
    $msg = '';
    $captcha_details = '';
    $is_captcha_on = get_option('cpt_enable');
    if ($_SERVER["REQUEST_METHOD"] == "POST" && $is_captcha_on == 'on') {
        $recaptcha = $_POST['g-recaptcha-response'];
        if (!empty($recaptcha)) {
            $secret = get_option('apt_recaptcha_private');
            $secret = empty($secret) ? 'Google secret key' : $secret;
            $captcha_data = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=" . $secret . "&response=" . $_POST['g-recaptcha-response']);
            $response = json_decode($captcha_data, TRUE);
            if ($response['success']) {
                $captcha_details = true;
            } else {
                $captcha_details = false;
                $error = array_search("invalid-input-secret", $response['error-codes']);
                if ($error == 0) {
                    $msg = "Please enter correct reCAPTCHA key.";
                } else {
                    $msg = "Please re-enter your reCAPTCHA.";
                }
            }
        } else {
            $captcha_details = false;
            $msg = "Please re-enter your reCAPTCHA.";
        }
    }
    $blank_data = "";
    if ((isset($_POST['submit']) && $is_captcha_on != 'on' && $cpt_true == false ) || (isset($_POST['submit']) && $captcha_details == true)) {
        $_POST['time'];
        if (($_POST['time'] == 'notavi') || ($_POST['service_select'] == 'notavi')) {
            echo "<p>Please Insert All data.</p>";
            $blank_data = true;
        } else {
            $blank_data = false;
            echo $badUrl = (isset($_POST['sr_price'])) ? $_POST['sr_price'] : null;
            if (get_option('apt_paypal') == "sandbox") {
                gateway_sandbox();
            } elseif (get_option('apt_paypal') == "paypal") {
                gateway_paypal();
            } elseif (get_option('apt_paypal') == "cash") {
                $datechange = $_POST['aptcal'];
                $dateformat = explode('/', $datechange);
                $newaptdate = $dateformat[1] . '/' . $dateformat[0] . '/' . $dateformat[2];
                cash_payment($_POST['service_select'], $_POST['time'], $newaptdate, $_POST['fname'], $_POST['aptemail'], $_POST['aptphone'], $_POST['aptmessage'], $_POST['aptugs'], $_POST['aptlawnarea'], $_POST['random']);
            }
        }
    }
    if (isset($_GET['paypal-trans'])) {
        ink_apt_trans_display();
    } else {
        $ruri = $_SERVER['REQUEST_URI'];
        $sname = $_SERVER['SERVER_NAME'];
        $fullpath = 'http://' . $sname . $ruri;
        update_option('return_apt_url', $fullpath);
        $br = new AptService();
        $iechk = $br->ink_browser();
        if ((!isset($_POST['submit'])) || ($check_apt != $cpt_apt) || ($captcha_details == false) || ($blank_data == true)) {
            ?>
            <div class="ink-container">
                <div class="inkappointment_wrapper">
                    <div class="inkappointment_form_top">
                    </div>
                    <div class="inkappointment_form_wrapper">
                        <form method="post" action="" id="ink-form" name="ink-form" class="ink-form" >

                            <header id="ink-header" class="ink-info">
                            </header>
                            <ul class="inkappform">
                                <li class="textheading"><h2><span class="msg_text"><?php echo get_option('apt_form_head'); ?></span></h2></li>
                                <li class="textfname"><input type="text" name="fname" id="fname" class="inktext inklarge inkrequired"   placeholder="Name"  maxlength="100" />
                                    <label id="apt_error"> </label>
                                </li>
                                <li class="textaptemail"><input type="email" name="aptemail" id="aptemail" class="inktext inklarge inkrequired" placeholder="Email"  maxlength="100" /></li>
                                <li class="textaptphone"><input type="text" name="aptphone" id="aptphone" class="inktext inklarge" placeholder="Contact Number"  maxlength="12” /></li>
                                <li class="textfixdate"><span class="fix_date"><?php echo get_option('apt_fix_date'); ?></span></li>
                                <li class="select_item"><select  id="service_select" name="service_select" class="inktext inklarge inkrequired" >
                                        <option  value="noavi">Select Service</option>
                                        <?php
                                        $showts = $wpdb->get_results("SELECT * FROM $apt_service ", ARRAY_A);
                                        foreach ($showts as $timerow) {
                                            ?>
                                            <option  value="<?php echo $timerow['service_id']; ?>"><?php echo $timerow['service_name']; ?></option>
                                        <?php } ?> </select></li>
                                <li class="textaptcal"><input type="text" name="aptcal" id="aptcal" class="dateField inktext inklarge"  placeholder="Select Date" /></li>
                                <li class="select_item"><select id="time" name="time" class="inktext inklarge inkrequired">
                                        <option value="notavi">Select Time</option>  </select></li>
                                <li class="textfixdate"><span class="fix_date">Do you have underground Sprinklers?</span></li>
                                <li class="textfixdate"><span class="fix_date"><input type="radio" name="aptugs" id="aptugs" value="yes" checked>Yes <input type="radio" name="aptugs" id="aptugs"” value="no">No</span></li>
                                <li class="textfixdate"><span class="fix_date">Area Required</span></li>
                                <li class="textfixdate"><span class="fix_date"><input type="radio" name="aptlawnarea" id="aptlawnarea" value="frontback" checked>Front+Back <br> <input type="radio" name="aptlawnarea" id="aptlawnarea" value="front">Front Only <br> <input type="radio" name="aptlawnarea" id="aptlawnarea" value=“back”>Back Only</span></li>
                                <li class="textfixdate"><span class="fix_date"><?php echo get_option('apt_custom_msg'); ?></span></li>
                                <li class="textaptmessage"><textarea name="aptmessage" id="aptmessage" class="inktext inklarge inkrequired" maxlength="255" rows="3" cols="50" placeholder="Address (required)" ></textarea></li>
                                <?php if ($is_captcha_on === 'on') { ?><li>
                                        <div class="g-recaptcha-div"><div class="g-recaptcha" data-sitekey="<?php
                                            if (get_option('apt_recaptcha_public')) {
                                                echo get_option('apt_recaptcha_public');
                                            } else {
                                                echo 'Google Public Key';
                                            }
                                            ?>"></div>
                                        </div>
                                        <span class='msg'><?php echo $msg; ?></span>
                                    </li>
                                <?php } ?>
                                <li class="submit_bg">
                                    <input type="hidden" name="random" id="random"  value="<?php echo rand(); ?>"/>
                                    <input type="submit" name="submit" id="submit"  class='ink-submit inkrequired' value="Book Appointment"/>  </li>
                            </ul>
                        </form>
                    </div>
                    <div class="inkappointment_form_bottom">
                    </div>
                </div>
            </div>
            <?php
        } //submit not set
    }
}

jQuery.noConflict();
jQuery(函数(){
jQuery(“#aptcal”).datepicker();
jQuery(“aptcal”).datepicker(“选项”,“minDate”,0);
});
  • >
  • 选择时间
  • 你们有地下洒水装置吗
  • 是否
  • 所需区域
  • 前+后
    仅前
    仅后

  • 以下函数缺少一个参数:cash\u payment()

    具有11个参数的函数定义:

    function cash_payment($sr_apt_id, $sr_apt_time, $sr_apt_date, $sr_apt_persion_name, $sr_apt_email, $sr_apt_phone, $sr_msg, $sr_apt_message, $sr_apt_ugs, $sr_apt_lawnarea, $sr_data_rand) {}
    
    cash_payment($_POST['service_select'], $_POST['time'], $newaptdate, $_POST['fname'], $_POST['aptemail'], $_POST['aptphone'], $_POST['aptmessage'], $_POST['aptugs'], $_POST['aptlawnarea'], $_POST['random']);
    
    函数调用10个参数:

    function cash_payment($sr_apt_id, $sr_apt_time, $sr_apt_date, $sr_apt_persion_name, $sr_apt_email, $sr_apt_phone, $sr_msg, $sr_apt_message, $sr_apt_ugs, $sr_apt_lawnarea, $sr_data_rand) {}
    
    cash_payment($_POST['service_select'], $_POST['time'], $newaptdate, $_POST['fname'], $_POST['aptemail'], $_POST['aptphone'], $_POST['aptmessage'], $_POST['aptugs'], $_POST['aptlawnarea'], $_POST['random']);
    

    如果除了传递空字符串之外,您没有任何值的第11个参数,但定义中的参数数量始终等于调用函数的参数数量。

    我认为此错误是由于现金支付函数中缺少参数造成的,请检查此函数的所有字段。 现金支付($\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\; }
    请尝试回显所有字段,并检查是否发现任何空值。

    指出php文件中出现错误的行?在调用现金支付时,您似乎改变了参数($\u POST['service\u select']、$\u POST['time']、$newaptdate、$\u POST['fname']、$\u POST['aptemail']、$\u POST['aptphone']、$\u POST['aptmessage']、$\aptugs'],$_POST['aptlawnarea'],$_POST['random']);可能您忘记了此函数的第一个参数,$sr_apt_idtry在定义时以及值传递给该函数时计算函数参数数。您会发现实际问题是什么?不,第一个参数没有丢失!缺少在定义中调用的参数$sr_msgArgument no.7这在定义$sr_msg中调用。谢谢。我刚刚删除了$sr_msg的两个实例,现在脚本正确执行。