473,406 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Hopefully Simple Question re Variables

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
search:

// 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
links:

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
stumped?

Many thanks,
Andrew
Aug 4 '08 #1
1 1466
Message-ID: <7d******************@news-server.bigpond.net.aufrom
Andrew contained the following:
>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
stumped?
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
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
http://slipperyhill.co.uk
Aug 4 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Mark | last post by:
I would really appreciate some help with this. I am a PHP neophyte, so please forgive me... I am building a site that will be used to display image galleries. Some galleries are public (can be...
38
by: jrlen balane | last post by:
basically what the code does is transmit data to a hardware and then receive data that the hardware will transmit. import serial import string import time from struct import * ser =...
27
by: Brian Sabbey | last post by:
Here is a first draft of a PEP for thunks. Please let me know what you think. If there is a positive response, I will create a real PEP. I made a patch that implements thunks as described here....
31
by: da Vinci | last post by:
OK, this has got to be a simple one and yet I cannot find the answer in my textbook. How can I get a simple pause after an output line, that simply waits for any key to be pressed to move on? ...
11
by: JKop | last post by:
Take the following simple function: unsigned long Plus5Percent(unsigned long input) { return ( input + input / 20 ); } Do yous ever consider the possibly more efficent:
7
by: Mark Prenter | last post by:
Hi all, I'm fairly new to .NET and I haven't done much in C++ before, nothing complex anyway, but I have a pretty good understanding of programming in general. What I'm trying to do is create a...
14
by: Giancarlo Berenz | last post by:
Hi: Recently i write this code: class Simple { private: int value; public: int GiveMeARandom(void);
2
by: DLN | last post by:
Hello all, I apologize for the naivety of this question, but I'm wondering whether session variables can ever be modified (somehow) by a client without having to go through code that I write. ...
1
by: Itanium | last post by:
Hi all! I'm new to .NET Platform and got some simple questions about efficiency... To put you in situation, to say that I'm involved in the writing of a complex regex based lexer for use over...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.