Friday, 25 June 2010

How to check session is exit or not using ajax call with jquery?

Hey fox please do the below mentioned code to check it out whether session is exist or not via ajax call:

Write down the following code while call ajax;

function callAjax()
               data: { fname: 'ashwani kumar' },             
              type: 'POST',
                  url: 'ajax.php',
                success: function(data) {
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    if (XMLHttpRequest.status === 500) {
                      location.href = 'index.php';

IN ajax.php file on top of the page write down the following code in your script:

    header("HTTP/1.0 500 Not Found");


1 comment: