title: isEmpty is not defined-error
body: <p>I was getting an error as isEmpty is not defined .what i have to do .while alerting too it is not showing any alert.   </p>
  
  <pre><code> &lt;!DOCTYPE html&gt;
              &lt;html&gt;
              &lt;head&gt;
              &lt;title&gt;Login page&lt;/title&gt;
              &lt;script type="text/javascript" src="js/jquery.min.js"&gt;
              &lt;/script&gt;
              &lt;script type="text/javascript" src="js/scripts.js"&gt;
              &lt;/script&gt;
       &lt;script type="text/javascript" src="js/bootstrap.js"&gt;
      &lt;/script&gt;
       &lt;script type="text/javascript" src="js/bootstrap-tooltip.js"&gt;
      &lt;/script&gt;
        &lt;script type="text/javascript" src="js/bootstrap-popover.js"&gt;
      &lt;/script&gt;
  
              &lt;script type='text/javascript'&gt;
  
      jQuery.fn.extend(
          {
          scrollToMe: function () {
              var x = jQuery(this).offset().top - 100;
              jQuery('html,body').animate({scrollTop: x}, 500);
            }
          }
        );
  
        function show_error(id_wth_hash, Message) {
          alert(id_wth_hash);
          alert(Message);
  
          //$("*[id]").popover('hide');
  
          //   $("[id^='id_*']").popover('hide');
          //    $("[id^='id_*']").popover('hide');
          // $("#id*").popover('hide');
  
  
  
          /*  var oArr = {};
         $("*[id]").each(function() {
         var id = $(this).attr('id');
         if (!oArr[id]) oArr[id] = true;
         });
         for (var prop in oArr)
         alert(prop); */
  
  
  
          //  alert(id_wth_hash);
  
          $(id_wth_hash).popover({title: "&lt;B style='color:red'&gt;Error&lt;\/B&gt;", content: Message, placement: 'left'});
          var popovertemp = $(id_wth_hash).data('popover');
          popovertemp.options.content = Message;
          $(id_wth_hash).popover('show');
          //$("*[id]").not(id_wth_hash).popover('hide');
          // $.not(id_wth_hash).popover('hide');
          $(id_wth_hash).focus();
          //$(id_wth_hash).scrollTop($('a#captchaAnchor').position().top)
  
          //$('html, body').animate({ scrollTop: $(id_wth_hash).offset().top }, 500);
  
          $(id_wth_hash).scrollToMe();
  
          /* $(id_wth_hash).focus(function() {
              $(id_wth_hash).popover('hide');
          });
         */
          $(id_wth_hash).bind("keyup input paste", function()
            {
              //Do Work Here
              $(id_wth_hash).popover('hide');
            }
          );
  
  
          $(id_wth_hash).click(function()
            {
              $(id_wth_hash).popover('hide');
            }
          );
  
  
  
          $(id_wth_hash).hover(function()
            {
              $(id_wth_hash).popover('hide');
            }
          );
  
  
  
  
        }
  
        $(function()
          {
  
            //show_error('#id_txt_user','I Have passed the value');
  
  
            $("#pwd_login").tooltip({title: 'Min.6 Characters , 1 number ,1 lowercase ,1 UpperCase,  1 Symbol are expected', placement: 'right'});
            $("#user_login").tooltip({title: 'Registered Email', placement: 'right'});
  
  
  
  
  
  
          }
        );
  
  
  
              function submit_login_form()
              {
              var action = "login_submit.php";
  
                  $.ajax(
                    {
                    url: 'login_submit.php',
                    type: 'POST',
                    data: $('#login').serialize(),
                    success: function(data_in) 
                      {
                        alert(data_in);
                        if (data_in !== null &amp;&amp; !isEmpty(data_in) &amp;&amp; (data_in).indexOf('VALIDATION_ERROR') !== -1)
                        {
                          var value = data_in.substr(data_in.indexOf('VALIDATION_ERROR'), data_in.indexOf('|#END#'));
                          var array_str = value.split('|');
                          var id_val = "#id_" + array_str[1].trim();
                          show_error(id_val, array_str[2]);
                        } else 
                        {
                          window.location.replace('jb_organization_regn_confirm.html');
                        }
                      }
                    }
                  );
                  return false;
              }
              &lt;/script&gt;
              &lt;/head&gt;
              &lt;body&gt;
              &lt;form action="login_submit.php" id="login"&gt;
              &lt;h1&gt;LOGIN&lt;/h1&gt;
              Email&lt;input value="" name="user_email" id="user_login"&gt;&lt;br&gt;
              Password&lt;input value="" name="pwd" type="password" id="pwd_login"&gt;&lt;br&gt;
              &lt;input type="checkbox" name="remember_me"&gt;Stay Signed In&lt;br&gt;
              &lt;input type="submit" value="login" onclick="submit_login_form()"&gt;  
              &lt;/form&gt;
              &lt;/body&gt;
              &lt;/html&gt;
  </code></pre>
  
  <p>This is my php page</p>
  
  <pre><code>&lt;?php require 'db.php'; ?&gt;
  &lt;?php require 'shopping_user_class.php'; ?&gt;
  &lt;?php 
  $error_op = " START ";
  $obj_shopping_login = new user;
  //$obj_shopping_login-&gt;shopping_user_name = "";
  $obj_shopping_login-&gt;shopping_user_pwd = "";
  $obj_shopping_login-&gt;shopping_user_email = "";
  $obj_shopping_login-&gt;remember_me = "";
  function Collect_all_form_variables() {
      global $obj_shopping_login;
      global $error_op;
  
      try {
  
          $obj_shopping_login-&gt;shopping_user_email = $_POST["user_email"];
          $obj_shopping_login-&gt;shopping_user_pwd = $_POST["pwd"];
  
          if (isset($_POST['remember_me']) &amp;&amp;
                  $_POST['remember_me'] == 'yes') {
              $obj_shopping_login-&gt;remember_me = 'yes';
          } else {
              $obj_shopping_login-&gt;remember_me = 'no';
          }
      } catch (Exception $e) {
          echo 'Error: ' . $e-&gt;getMessage();
          $error_op = 'Collect_all_form_variables' . $error_op . $e-&gt;getMessage();
      }
  
  }
  function check_useremail_and_password($current_user_email,$current_user_pwd) {
      global $error_op;
  
  
      try {
          global $pdo;
  
  
  
          $sth = $pdo-&gt;prepare("SELECT * from photostudio.user WHERE  UPPER(email) =  UPPER(:current_user_email) AND pwd=:current_user_pwd");
  
  // Execute the query, replacing the placeholders with their true value
          $sth-&gt;execute(array(
              ':current_user_email' =&gt; trim($current_user_email),
              ':current_user_pwd'=&gt;current_user_pwd
          ));
  
          if ($sth-&gt;rowCount() &gt; 0) {
  
              return true;
          }
  
          return false;
      } catch (PDOException $e) {
          echo 'Error: ' . $e-&gt;getMessage();
          $error_op = 'check_useremail_and_password ' . $error_op . $e-&gt;getMessage();
      }
  
      return true;
  }
  function validate_form_stage1() {
  
  //alert("please");
      $required = array('user_email', 'pwd');
  
  // Loop over field names, make sure each one exists and is not empty
      $error = false;
      foreach ($required as $field) {
          if (empty($_POST[$field])) {
              $error = true;
              break;
          }
      }
  
      if ($error) {
          return "VALIDATION_ERROR|" . $field . "|Value is Required|#END#";
      } else {
          return "SUCCESS";
      }
  } 
  function process_request() {
  
  
      global $obj_shopping_login;
  
      global $error_op;
  
      $all_values_are_present = validate_form_stage1();
  
      if (substr($all_values_are_present, 0, 16) === "VALIDATION_ERROR") {
  
  
          echo $all_values_are_present;
          return false;
      }
  
      Collect_all_form_variables();
      if (check_useremail_and_password() == true) {
  
          echo "Success" . $error_op;
  
  
      } else {
  
          echo "Failed" . $error_op;
      }
  }
  ?&gt;
  </code></pre>
  
  <p>If my username and password are incorrect too then it is showing that.</p>