开发者

Undefined index error [closed]

开发者 https://www.devze.com 2023-03-29 09:36 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 11 years ago.开发者_运维百科

i am trying to Post something but keep getting Undefined index error. I have encountered this problem before and using if(isset($_POST['in_come']) solved my previous problem. But, now it does not. What can cause this problem? Everything seems correct.Html posts an input and php should have gotten it Thanks


The problem is caused by you trying to access an array index that doesn't exist. E.g:

$foo = array('bar');
echo $foo[99999];

That means you have a logic error somewhere in your code.


This error is caused by passing an invalid index to an array, whether it be a string or integer index. Using if(isset($_POST['in_come']) should return false if it doesn't exist though, and not throw an error. If you would post your code, people could be more helpful

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号