“Notice: Undefined variable”, “Notice: Undefined index”, and “Notice: Undefined offset” using PHP

后端 未结 28 1313
盖世英雄少女心
盖世英雄少女心 2021-01-24 14:18

I\'m running a PHP script and continue to receive errors like:

Notice: Undefined variable: my_variable_name in C:\\wamp\\www\\mypath\\index.php on line 10

28条回答
  •  情书的邮戳
    2021-01-24 14:41

    In a very Simple Language.
    The mistake is you are using a variable $user_location which is not defined by you earlier and it doesn't have any value So I recommend you to please declare this variable before using it, For Example:


    $user_location = '';
    Or
    $user_location = 'Los Angles';
    This is a very common error you can face.So don't worry just declare the variable and Enjoy Coding.

提交回复
热议问题