I am using a session parameter to count the number of searched parameters (as I will be using them later).
I want to set this parameter to 0 when there is no search,
so I used this:
(this is done in an included file that runs before anything else and is responsible for sessions, initializing and such)
if(!$_GET["s"])
{
$_SESSION["search_parameters"] = 0;
}
I encountered a problem that happens in IE but doesn’t happen in Opera.
When I refresh the search-results page, for some reason the $_SESSION["search_parameters"] was set to 0,
although it shouldn’t have.
Trying to find the problem I changed the code a bit
if(!$_GET["s"])
{
$_SESSION["search_parameters"] = 0;
?>
<script language="JavaScript" type="text/javascript">
alert('something');
</script>
<?
}
There where 2 interesting results to this test
1) there was no alert where there shouldn’t be an alert, so I still don’t know what set the session var to 0.
2) At other pages I got 2 alerts (!) instead of the expected 1, and it happened in IE only!
Anyone has any idea?