I am building a URL and a SELECT query at the same time. I have a GET method form on search.php. It sends the user to searchResults.php where I am retrieving searchStatus:
[code=php]<?php
if ( !empty($_GET[‘searchStatus’]) ) # if searched
{
$_SESSION[‘status’] = mysql_real_escape_string($_GET[‘searchStatus’]); # get selected status from previous page
$searchStatus = $_SESSION[‘status’];
$querySearch.= “AND vigil_call.status_num = ‘$searchStatus’ “;
}
if ( !empty($_GET[‘refreshStatus’]) ) # if refreshed, grab session from URL
{
$refreshStatus = mysql_real_escape_string($_GET[‘refreshStatus’]);
$querySearch.= “AND vigil_call.status_num = ‘$refreshStatus’ “;
}
?>
If the user is sent from the previous page, then the query is built with the searched status. However, this results page is auto refreshed. On the refresh, I am trying to display the same results … just updated. So, I am grabbing the session from the newly built URL.
[code=php]<?php
# build URL
$url = “?lastCall=” . $_SESSION[‘dbLast’] . “&refreshEagle=” . $_SESSION[‘eagle’] . “&refreshStatus=” . $_SESSION[‘status’] .
“&refreshHall=” . $_SESSION[‘hall’]. “&refreshTech=” . $_SESSION[‘tech’];
?>
I am testing by echoing the values of the 2 variables and it correctly echoes a duplicate number:
[code=php]<?php
echo “status: ” . $_SESSION[‘status’];
echo “<br>refresh status: ” . $refreshStatus;
?>
The query is successful when first reaching the page and I get my results, but upon refresh the I have no results. Undecided Can someone be of assistance? Or maybe you know of an easier/cleaner method to achieve the same effect?