GumSlone was right from the first place you just didn't get it
this error is not important just remove ~E_NOTICE from error reporting.
by removing it means
// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
Notice: Undefined variable: who in /home/ pr0blem can't solve
Collapse
X
-
Older versions of PHP will ignore this type of errors but all the currents versions of PHP are made to work somehow like c++ and Java.Because in Java and c++,U will need to declare a variable before initializing it.Its is very much recommended.Its very annoying doing it but programmers in C++ and Java will see it normal.
So here U were to declare :
We declared $who to null or empty variable.After declaring it to an empty variable,You then asign $_POST to itCode:$who="";
so it will be
As Gumslone to said,the error is not of important so U can decide to hide it using :Code:$who=""; $who=$_POST['who'];
it is not recommended to hide all errors ,so I will not advise you to useCode:error_reporting("E^NOTICE");
Code:error_reporting("E^ALL"); or error_reporting(0);
Leave a comment:
-
well try E_NOTICE i know you want a error free site but thats probaly nothing to worry about.
Leave a comment:
-
Originally posted by bOrN2pwn View PostYour script assumes that all variables ($who) are registered globally. This is a bad assumption to make.
Rather, use the variable from the $HTTP_POST_VARS array:
$who = $HTTP_POST_VARS["who"];
If you're using PHP version 4.1 or higher, you can alternatively use $_POST instead of $HTTP_POST_VARS.
Have fun...
lol i found this on google bro but it don't work !
Leave a comment:
-
Your script assumes that all variables ($who) are registered globally. This is a bad assumption to make.
Rather, use the variable from the $HTTP_POST_VARS array:
$who = $HTTP_POST_VARS["who"];
If you're using PHP version 4.1 or higher, you can alternatively use $_POST instead of $HTTP_POST_VARS.
Have fun...
Leave a comment:
-
i try like that in php.ini but it just hide the error codes like my problem error
Leave a comment:
-
damn it works ! hehe
i am getting hard with my site it seems i need to put that in every error that i find like that damn!
thanks to you!
Leave a comment:
-
ok i will try hehe but when i install it on another hosting ,codes work fine
Leave a comment:
-
Okay i spot ur problem. Um ima just explain so u can help urself debug next time.
1st error: Undefined variable who. . .
The error occurs when you are trying to assign an undefined variable. In ur case its close to dat line.
2nd error: Undefined index lstloc. Usually when the requested array index is nt found. In ur case, the $_GET array doesnt contain d lstloc index. You can fix it in the url e.g &lstloc=value or beta stil, like dis:Code:wrong: $nix = getnick_uid($who); correct: $who = (int) $_GET['who']; $nix = getnick_uid($who);
3rd error: undefined var who. Same as 1st error. Solving error 1 will fix it.Code:$lstloc = isset($_GET['lstloc']) ? $_GET['lstloc'] : NULL; $lastloc = cleanQuery($lstloc);
4th error. Another undefined array index. This time in the $_POST array. Solve dis by:
PHP Code:if(empty($who)){
$mnick = isset($_POST['mnick']) ? $_POST['mnick'] : NULL;
/* if(empty($who)) is a beta way of writing if($who == "" || $who == 0) */
Leave a comment:
Leave a comment: