ajax how to read out $_post variable

Posted by alex on Stack Overflow See other posts from Stack Overflow or by alex
Published on 2010-03-04T12:04:06Z Indexed on 2010/03/28 19:23 UTC
Read the original article Hit count: 160

Filed under:
|
|

Hi,

I am trying to filter/search a database with ajax

$.ajax({
   type: "POST",
   url: "filterSearch.php",
   queryString: qry,
   success: function(data){
     alert( "Data Saved: " + data );
     $('#searchResult').html(data); // Fill the search results box

   }
 });

Now in filterSearch.php i have the following test codes

if(isset($_POST['queryString'])) {
    echo "TEST";
}
if($_POST['runquery']==1) {

$sql = "SELECT * FROM fs_vacatures WHERE here-the-like-query?";
$msg =  $sql;
echo $msg;
die();
}

die();

But nor TEST or the $sql is return in the alert??

© Stack Overflow or respective owner

Related posts about AJAX

Related posts about php