Notice: Undefined variable: who in /home/ pr0blem can't solve

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • just_m3.
    replied
    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);
    Last edited by just_m3.; 10.01.12, 02:58.

    Leave a comment:


  • razzbee
    replied
    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 :
    Code:
    $who="";
    We declared $who to null or empty variable.After declaring it to an empty variable,You then asign $_POST to it
    so it will be
    Code:
    $who="";
    $who=$_POST['who'];
    As Gumslone to said,the error is not of important so U can decide to hide it using :
    Code:
    error_reporting("E^NOTICE");
    it is not recommended to hide all errors ,so I will not advise you to use
    Code:
    error_reporting("E^ALL"); or error_reporting(0);

    Leave a comment:


  • bOrN2pwn
    replied
    well try E_NOTICE i know you want a error free site but thats probaly nothing to worry about.

    Leave a comment:


  • wapmetal
    replied
    Originally posted by bOrN2pwn View Post
    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...

    lol i found this on google bro but it don't work !

    Leave a comment:


  • bOrN2pwn
    replied
    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:


  • wapmetal
    replied
    in phpinfo(); found

    error_reporting 6143 6143

    Leave a comment:


  • wapmetal
    replied
    ok fixed! thanks
    Last edited by wapmetal; 03.04.10, 13:03.

    Leave a comment:


  • wapmetal
    replied
    i try like that in php.ini but it just hide the error codes like my problem error

    Leave a comment:


  • CreativityKills
    replied
    Yea. error_reporting() function. Check php.net

    Leave a comment:


  • wapmetal
    replied
    Originally posted by mobileGIGS View Post
    Dats cuz they myt ave E NOTICE off by default.

    then can i turn it ON?

    Leave a comment:


  • wapmetal
    replied
    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:


  • CreativityKills
    replied
    Dats cuz they myt ave E NOTICE off by default.

    Leave a comment:


  • wapmetal
    replied
    ok i will try hehe but when i install it on another hosting ,codes work fine

    Leave a comment:


  • CreativityKills
    replied
    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.
    Code:
    wrong:
    $nix = getnick_uid($who);
    
    correct:
    $who = (int) $_GET['who'];
    $nix = getnick_uid($who);
    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:
    $lstloc = isset($_GET['lstloc']) ? $_GET['lstloc'] : NULL;
    $lastloc = cleanQuery($lstloc);
    3rd error: undefined var who. Same as 1st error. Solving error 1 will fix it.

    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:


  • wapmetal
    replied
    is there other way to solve this? not just hidding these errors?

    Leave a comment:

Working...
X