javascript - alert(message) returns an empty string -


solved @hanky 웃 panky!

i implementing login function.

the javascript part:

function login() {     var n = $('#userl').val();     var p = $('#passl').val();     if ( n != "" && p != ""){         $.post("functions.php",{userl: n, passl: p}).done(function(mesaj){             if(mesaj  == "")                alert("!!!!!!!!!!empty string!!!!!");             else             alert(mesaj);         });     }     else {         alert("enter name and/or passwort");     } }; 

and function function.php looks:

function login($nume,$parola) {     $sql = "select id `users` nume ='".$nume."' password = '".md5($parola)."'";     $q = mysql_query($sql);     if(!$q)         die(json_encode(array("mesaj" => "invalid")));     else{         $x = mysql_fetch_array($q);         if (empty($x))             die(json_encode(array('mesaj' => 'the user not exist')));         else {         //    $user = new user($x['id']);             session_start();             $_session['user_id'] = $x['id'];             $_session['loggedin'] = "yes";             die(json_encode(array("mesaj"=>"you logged")));         }          }     //this part may useless     die(json_encode(array("mesaj"=>"you not logged"))); }   if (isset($_post['nume']) , isset($_post['parola']))          login($_post['nume'], $_post['parola']); 

the problem keeps alerting empty string , think doesn'n acccess login function php...so message comes way went: empty

  $.post("functions.php",{userl: n, passl: p}) 

compare with

if (isset($_post['nume']) , isset($_post['parola'])) 

and spot error :)

you sending user1 , pass1 , in php checking nume , parola don't exist obviously.