checking session with jquery from php script then saving the item clicked to mysql database and updating the label which has been clicked
<p>hi I am trying to saving to save item into my sql database I have 3 functions </p>

<pre><code>/* the function below checks if a session is pressent using jquery ajax call to php script */


function checkSess(){
                         $.ajax({
                         url: "check_s.php",
                         cache: false,
                         success: function(data){
                                                processDetails1(data)
                                                }
                                 });
                     }


&lt;?php
session_start(); 
if(isset($_SESSION['flipmode']))
{ 

    echo "u";
}
 else {
    echo "n";
}

?&gt;


/* the function below checks if value from checkSess() is true or false */


function processDetails1(info){

              if(info==='u'){

                  return true;
              }
               else{
                    return false;
                }
           }





/* the function below checks if value from checks all data then saves to database and changes label if the result from processDetails1 and if true is returned then changes label details and if it returns false should open dialog*/


$('.savepropertycon').live('click', function() {
                var chekH = checkSess();
                if(chekH===true){
                     $.get("saveprop.php", { pid: saveId },
                            function(data){
                    $('#dialog-message').dialog('open');
                                $('#pro').html(data);
                                return false; 
                                        });


                var saveCurrentId = $(this).attr('id');

                    jQuery("label", this).html('saved');
                    $(this).removeClass();
                    $(this).removeAttr('href');
                    $(this).addClass("savedone");
                    jQuery("img", this).remove();


                }
                else {

                    $('.dialogsign').dialog('open');

                }




                return false;
            });
</code></pre>

<p>The problem I have is the above keeps and returning false I have tried to debug with firebug and var chekH is coming back as undifined. Please could somebody help thank you.</p>
