this code:
$_SESSION["$SearchTerm"] = $_GET['SearchTag'];
$_SESSION["$SearchTerm"] = preg_replace("#[^0-9a-z]#i","",$SearchTerm);
doesn't look right. you can't use a variable in the session name.
try:
$_SESSION["SearchTerm"] = $_GET['SearchTag'];
$_SESSION["SearchTerm"] = preg_replace("#[^0-9a-z]#i","",$_SESSION["SearchTerm"]);
when reporting an error, I need a copy of the page so i can see what the code in the error is.