473,396 Members | 1,804 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,396 software developers and data experts.

Persistent global variable?

Hi,

Are there something like a `Persistent global variable` in PHP?

It is something like `Application` in the classic ASP, all the request
share the same variable, and the die after a timeout.

Sep 27 '06 #1
2 7251
ho******@gmail.com said the following on 27/09/2006 16:49:
Hi,

Are there something like a `Persistent global variable` in PHP?

It is something like `Application` in the classic ASP, all the request
share the same variable, and the die after a timeout.
Sessions.
http://php.net/manual/features.sessions.php

Be aware that sessions are not cross-user though. Each user has their
own set of independent persistent variables.

--
Oli
Sep 27 '06 #2
David Gillen said the following on 27/09/2006 17:22:
An noise sounding like Oli Filth said:
>ho******@gmail.com said the following on 27/09/2006 16:49:
>>Hi,

Are there something like a `Persistent global variable` in PHP?

It is something like `Application` in the classic ASP, all the request
share the same variable, and the die after a timeout.
Sessions.
http://php.net/manual/features.sessions.php

Be aware that sessions are not cross-user though. Each user has their
own set of independent persistent variables.
Pass the same session id to session_id() after you start the session should
give you the same session for all users. A bit hacky though. If it even works.
Can't see why it wouldn't though.
Of course, that then presents the users from having any "personal"
variables at all...
--
Oli
Sep 27 '06 #3

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

Similar topics

4
by: M. Katz | last post by:
I'm relatively new to PHP/MySQL and I've heard about maintaining a persistent connection to the database. To save overhead, I'd like to maintain the connection in a session variable, but I have a...
3
by: Elias Farah | last post by:
Dear Access Peers, I am having a problem over a network, where the Database takes 5-Mins to load instead of the normal 5 seconds. It has only started to do this since I split the frontend &...
2
by: Eric Ellsworth | last post by:
Hi, I'm working on an Access database which eventually be connected to an ODBC data source (probably postgres), but for now has an .mdb backend. The idea is to use the password to authenticate...
7
by: Bill R via AccessMonster.com | last post by:
I get the error msg "Object variable or With block variable not set" when closing the "persistent" recordset I opened when the application opened. I have the rs variable declared in the...
1
by: Ryan | last post by:
The real reason for my previous post about intercepting Application_EndRequest (from outside of Global.asax) is because of a need to create a "non persistent page level cache". I can't seem to...
7
by: Tony M. | last post by:
I'm trying to execute an append query. I have a case that works, and one that returns an object not set error. THIS WORKS: Private Sub cmdArchiveRecs_Click() BeginTrans CurrentDb.Execute...
3
by: Arnost Sobota | last post by:
Dear ASP community, I have a question regarding ASP session variables. My assumption was that a session variable has the same lifetime as the session itself: as a consequence, given that...
1
weaknessforcats
by: weaknessforcats | last post by:
C++: The Case Against Global Variables Summary This article explores the negative ramifications of using global variables. The use of global variables is such a problem that C++ architects have...
9
by: mel | last post by:
Hi all, I need a persistent TCP connection with my web server over page reloads. This means that, even if the user goes to a different page (in my domain), I want to keep a TCP connection...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.