Home  >  Article  >  Backend Development  >  apache的日志里有php的异常日志,这是咋回事呢

apache的日志里有php的异常日志,这是咋回事呢

WBOY
WBOYOriginal
2016-06-13 13:49:281073browse

apache的日志里有php的错误日志,这是怎么回事呢?
先贴apache日志里的php错误:

[Tue Jan 17 11:14:10 2012] [error] [client 101.226.33.217] PHP Notice: Undefined index: aliorder in /home/alipay/alipayto.php on line 24
[Tue Jan 17 11:14:10 2012] [error] [client 101.226.33.217] PHP Notice: Undefined index: alibody in /home/alipay/alipayto.php on line 25
[Tue Jan 17 11:14:10 2012] [error] [client 101.226.33.217] PHP Notice: Undefined index: alimoney in /home/alipay/alipayto.php on line 26
[Tue Jan 17 11:14:10 2012] [error] [client 101.226.33.217] PHP Notice: Undefined index: pay_bank in /home/alipay/alipayto.php on line 29


alipayto.php文件就是支付宝的接口文件,是支付宝官方提供的
24行开始是:
$subject = $_POST['aliorder']; //$_POST['aliorder']订单名称,显示在支付宝收银台里的“商品名称”里,显示在支付宝的交易管理的“商品名称”的列表里。
$body = $_POST['alibody']; //订单描述、订单详细、订单备注,显示在支付宝收银台里的“商品描述”里
$total_fee = $_POST['alimoney']; //订单总金额,显示在支付宝收银台里的“应付总额”里



我的支付页面也很简单的,是这样:








看上面的错误日志,意思是说从支付页面过来,没有收到post值?明明有值的,这个究竟是怎么回事呢?

------解决方案--------------------
apache 日志里有php的错误内容这个正常.

至于你这个错误本身其实它仅仅是一个提示。

解决的方法是在各个变量前做一个判断

例如 

if (isset($_POST['aliorder'])){
$subject = $_POST['aliorder']; 
}

即可

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn