2012-06-20

PHP : Notice: Undefined variable

I have this error
Notice: Undefined variable: s in xxx
how to fix this?
Answer:
This come out because we use/type like this
$s.=bla bla;
 meanwhile.. you not declare the variable. PHP allow you to type directly like that, but for security issue..

You should declare first like this
$s="";
$s.=$a[one]."<br>";
$s.=$a['one']."<br>";

die($s);
 The error show because you using error_reporting(); If you can't handle all the error, try lower the reporting to 1 or 0!!
0: no report

Tidak ada komentar: