My application has a search / query feature where in the user selects the search criteria and is displayed a page containing the reults. The user must also be allowed to edit these results and save them later on. On the results page I use the following logic,
// // START OF PSEUDOCODE //
<? session_start()
if ($submit) { yada yada yada
Update the database with the changes the user has made in the form
$value = $_GET['val']; echo ": ".$value."<br>";
$UpdateString = "UPDATE contacts SET
... .... .... ..... .... where WHERE `company` = '$value' ";
}
elseif (isset(_SESSION['validuser'])) {
display the form with the results of the search
<form name="form1" method="post" action="full_profile_1.php?val=$company">