Hopefully Simple Question re Variables

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm learning PHP so this might be a simple question to more expeienced
developers hopefully.

I have a findrecords.php page which has the following code which creates a
new record in a database table if this is the first time the user performs a

// Web Session tracking
 if (isset ($_SESSION['new_search'])) {
 // nothing - we don't want to add a new record if this is set
 } else {
        $request = $fm->newAddCommand('web_sessions');
        $result = $request->execute();

  $recordID = $result->getFirstRecord()->getRecordId();
  $_SESSION['new_search'] = "Yes";
  $_SESSION['web_session_id'] = $recordID;

On the recordlist.php page which displays the search results there are 2

1 - Continue searching - this should just go back to the findrecords.php
page and let the user do another search (this is working fine)

2 - New Search - this should take the user back to the findrecords.php page
and clear the $_SESSION['new_search'] variable only if that link is clicked.

I can't work out how you can pass some kind of parameter to the
findrecords.php page to indicate that the user has click the "New Search"
link? If I can capture that I can clear the variable but this one has me

Many thanks,

Re: Hopefully Simple Question re Variables

Andrew contained the following:

Quoted text here. Click to load it

Make the link  findrecords.php?action=newsearch

Then at the top of findrecords.php

if(isset($_GET['action']) &&$_GET['action']=="newsearch"){
unset($_SESSION['new_search'] );

However, from a users point of view, what is the difference between
continue searching and a new search?
Geoff Berrow  0110001001101100010000000110

Site Timeline