I have a custom page to run a search. If the search fails, I would like an Alert box to popup informing the user.
On my custom search page, I have it set a $_SESSION variable with the appropriate error message.
I am trying to write some code on the tbl_main_page.php page to display my message.

I've tried something like this:
Code:
<?php
//CHECK FOR ERROR AND DISPLAY IT
if(isset($_SESSION['badsearch'])) {
	$errormsg = $_SESSION['badsearch'];
	echo "<script>alert(\"$errormsg\"); </script>";	
	unset($_SESSION['badsearch']);
}
?>
but, nothing shows up.

Anyone have any ideas how I can make this work?