HI all,
On every page in my site is a search box named txtSearch. The form calls search.php. In search.php, the value of txtSearch is tested against entries in the database. That works fine.
But here is the problem. Let's say I start on the home page (index.php). I enter apples for a search term. The search.php page appears with any "apples" returned from the database. Now I am still on the search page. I enter "oranges". The search page still returns apples.
How can a form on a page, call itself for the action, and make the page rerun it's code (in this case querying the database for oranges).
I thought perhaps I have to clear the cache. So I tried this code...
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
... but it did nothing.
Any ideas?? Help!
Thanks,
KB
On every page in my site is a search box named txtSearch. The form calls search.php. In search.php, the value of txtSearch is tested against entries in the database. That works fine.
But here is the problem. Let's say I start on the home page (index.php). I enter apples for a search term. The search.php page appears with any "apples" returned from the database. Now I am still on the search page. I enter "oranges". The search page still returns apples.
How can a form on a page, call itself for the action, and make the page rerun it's code (in this case querying the database for oranges).
I thought perhaps I have to clear the cache. So I tried this code...
<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
... but it did nothing.
Any ideas?? Help!
Thanks,
KB