how to make an ajax search
<p>I'm trying to make an ajax search for a website,</p>

<p>HTML :</p>

<pre><code>&lt;form id="search" method="post" action="search.php"&gt;
        &lt;input type="text" name="search" /&gt;
        &lt;input type="image" name="submit" alt="search" src="images/buttons/search.gif" /&gt;   
    &lt;/form&gt;



 $(function() {
    var search_text = '';
    $('form#search input[name=submit]').click(function() {
     search_text = $('form#search input[name=search]').val();
     $.get('../search.php',{ s: search_text });
     return false;
    });

});
</code></pre>

<p>in the search.php file I have the following</p>

<pre><code>&lt;?php
    $search = $_GET['s'];
if (isset($_POST['submit_x'])) {

     $search = $_POST['search'];
     $search = str_replace(' ','',$search);
     $search = strtolower($search);


     if($search == 'kingbabychosenheart' || $search == 'chosenheart' || $search == 'beltchosenheart') {
      echo "&lt;meta http-equiv='refresh' content='0;url=chosen_heart.php'&gt;";
     }
else {
      echo "&lt;meta http-equiv='refresh' content='0;url=not_found.php'&gt;";
     }


    }

?&gt;
</code></pre>

<p>but this doesn't work, what else do I have to do to make this work?</p>

<p>thanks </p>
