【问题标题】:Issue getting a payment form to work让付款表格生效的问题
【发布时间】:2014-05-20 14:31:23
【问题描述】:

我一直在帮助一位朋友在他的网站上修复他的付款表单,但是在修复了一些数据库错误之后,现在出现了一个我似乎无能为力的错误。报错如下:

注意:未定义变量:strEPDQ in /home/sites/mulgas.co.uk/public_html/payments.php 第 274 行

现在看代码后看不出问题由于代码很多,我把它切到相关的部分

    #for each line in the response check for the presence of the string 'epdqdata'
#this line contains the encrypted string
$response_line_count=count($response_lines);
for ($i=0;$i<$response_line_count;$i++){
    if (preg_match('/epdqdata/',$response_lines[$i])){
        $strEPDQ=$response_lines[$i];
    }
}
?>

如果您需要更多信息,我会提供

【问题讨论】:

  • 只需将$strEPDQ = '' ; 设置在count() 的顶部

标签: php payment


【解决方案1】:

这应该可以解决问题:

#for each line in the response check for the presence of the string 'epdqdata'
#this line contains the encrypted string
$strEPDQ = '';
$response_line_count=count($response_lines);
for ($i=0;$i<$response_line_count;$i++){
    if (preg_match('/epdqdata/',$response_lines[$i])){
        $strEPDQ=$response_lines[$i];
    }
}
?>

这只是一个通知,不是很严重。 :-)

【讨论】:

  • 感谢您的快速回复,但是,我把它放在旧代码上,我仍然收到相同的未定义变量通知
  • $strEPDQ 没有在其他地方使用?
  • 它在其他地方使用过,但这只是引起通知的调用: 再往下一点
  • 100% 确定错误指的是这些代码行吗?
  • 不,在那段代码之前没有任何地方&是的,这就是该行所指的,我现在再检查一下
猜你喜欢
  • 2021-11-08
  • 2018-07-04
  • 2014-06-27
  • 2014-11-05
  • 2011-08-31
  • 2015-11-07
  • 2013-03-09
  • 2015-02-27
  • 2014-01-23
相关资源
最近更新 更多