Re: [PHP] Global Variables

2005-04-28 Thread John Nichel
Dan wrote: Hi all. I taught myself PHP before the frenzy over register_globals. After a reasonable break from the language, I'm back for more. I'm building a site where I'll be holding a lot of variables in memory for each session. How do I do that? Apparently I can't use session_register() if re

Re: [PHP] Global Variables

2005-04-28 Thread Jochem Maas
Giulio wrote: As far as I know, it's not true you can't use session variables if register_globals is off, the difference is that you must acces session variables using ALWAYS CALL session_start() BEFORE TRYING TO USE THE $_SESSION SUPERGLOBAL! also I don't quite see the connection with register_gl

Re: [PHP] Global Variables

2005-04-28 Thread Giulio
As far as I know, it's not true you can't use session variables if register_globals is off, the difference is that you must acces session variables using $_SESSION['variablename'], that's is an assurance that a session variable is a REAL session variable, and that it is not set using for exampl

Re: [PHP] Global Variables

2005-04-28 Thread Dan Rossi
session_start(); $_SESSION['somevar'] = "foo"; u could also check out pear's HTTP_Session package. On 28/04/2005, at 7:06 PM, Dan wrote: Hi all. I taught myself PHP before the frenzy over register_globals. After a reasonable break from the language, I'm back for more. I'm building a site where I'll

Re: [PHP] Global variables in a class? Nested classes VS inheritance...

2003-07-30 Thread Tom Rogers
Hi, Thursday, July 31, 2003, 1:30:54 AM, you wrote: amc> Hello, amc> I'm lookin for some tips on the best way to do this... amc> I make a database connection outside of my classes... lets call it amc> $myDBConnection. I need to use this connection in a class nested in a amc> class... Was wonderi

Re: [PHP] global variables

2003-01-17 Thread Marek Kilimajer
For this use globals, it would be painfull to pass everything. But you can also use some class that would keep track of such things. Dara Dowd wrote: Is it "better" to pass variables through functions or to simply declare them as global within the function's scope? The variables in this particul

Re: [PHP] global variables

2003-01-17 Thread Jason k Larson
In terms of security, or in my opinion, good and proper coding, it is best to have no global variables. There is always a way to wrap variables that will be needed in local scopes. However, this philosophy is harder to practice than it is to preach. Code can get ugly when passing if you are

Re: [PHP] Global variables question

2002-11-10 Thread Ernest E Vogelsinger
At 21:49 10.11.2002, Mathieu Dumoulin said: [snip] >Hi, i got this project i'm building right now. It basically a core system to >do adminsitrative modules for web sites. > >I got tons of classes that get created on call of a function like >sql_setup(), frm_s

Re: [PHP] Global Variables Off

2002-11-05 Thread Martín Marqués
On Lun 04 Nov 2002 00:10, Paul wrote: > Ok, I have turned global vars off and I have replaced my old > $HTTP_GET_VARS with $_GET[] but I seem to not get the values passed. I > run the phpinfo and I see the variables being stored as > _GET["variable_name"] > > Is calling $_GET["variable_name"] corre

Re: [PHP] Global Variables Off

2002-11-03 Thread @ Edwin
Hello, "Paul" <[EMAIL PROTECTED]> wrote: > OK I guess I am closer = the variable is being passed as I tested but I > guess is failing on the test: > > if (isset($_GET["error_message"])) > What do you mean by "failing on the test"? What are you trying to accomplish, btw? How are you testing it? Al

Re: [PHP] Global Variables Off

2002-11-03 Thread rija
ROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, November 04, 2002 3:02 PM Subject: RE: [PHP] Global Variables Off > Makes no difference..I tried them both > > -Original Message- > From: John Nichel [mailto:jnichel@;by-tor.com] > Sent: Sunday, November 03, 2002

RE: [PHP] Global Variables Off

2002-11-03 Thread Paul
1:08 PM To: Paul Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Global Variables Off I assume you mean that the echo statement I gave as an example shows this: The test variable is [] Right? If so, that is truly odd, especially considering you are using 4.2.3. I don't have a good answer for that ...

Re: [PHP] Global Variables Off

2002-11-03 Thread Justin French
mailto:shiflett@;php.net] > Sent: Sunday, November 03, 2002 10:15 PM > To: Paul > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Global Variables Off > > You didn't really tell us how you're passing data or what is not > working. > > Try this. Create a tes

Re: [PHP] Global Variables Off

2002-11-03 Thread Chris Shiflett
assigned to _GET. With no change in code, I turn global variables 'on' and the same page works.. Paul PS using php 4.2.3 -Original Message- From: Chris Shiflett [mailto:shiflett@;php.net] Sent: Sunday, November 03, 2002 10:15 PM To: Paul Cc: [EMAIL PROTECTED] Subject: Re: [PHP]

RE: [PHP] Global Variables Off

2002-11-03 Thread Paul
Makes no difference..I tried them both -Original Message- From: John Nichel [mailto:jnichel@;by-tor.com] Sent: Sunday, November 03, 2002 10:59 PM To: Paul Cc: 'Chris Shiflett'; [EMAIL PROTECTED] Subject: Re: [PHP] Global Variables Off Try single quotes... $_GET['test

Re: [PHP] Global Variables Off

2002-11-03 Thread John Nichel
urn global variables 'on' and the same page works.. Paul PS using php 4.2.3 -Original Message- From: Chris Shiflett [mailto:shiflett@;php.net] Sent: Sunday, November 03, 2002 10:15 PM To: Paul Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Global Variables Off You didn't really

RE: [PHP] Global Variables Off

2002-11-03 Thread Paul
Paul PS using php 4.2.3 -Original Message- From: Chris Shiflett [mailto:shiflett@;php.net] Sent: Sunday, November 03, 2002 10:15 PM To: Paul Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Global Variables Off You didn't really tell us how you're passing data or what is not working.

Re: [PHP] Global Variables Off

2002-11-03 Thread Chris Shiflett
You didn't really tell us how you're passing data or what is not working. Try this. Create a test script called test.php that looks like this: echo "The test variable is [" . $_GET["test"] . "]"; ?> Assuming this script is located at http://example.org/test.php, access this page using a URL li

Re: [PHP] global variables that are arrays

2002-10-08 Thread Christopher J. Crane
I didn't do it yet. The script I am working on is large with many variables so I was hoping someone else would know before I do it. "Chris Hewitt" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Christopher J. Crane wrote: > > >Can I do this? > >global $Ticker=

Re: [PHP] global variables that are arrays

2002-10-08 Thread Chris Hewitt
Christopher J. Crane wrote: >Can I do this? >global $Ticker=array(); > I don't know, what happens when you try it? HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Global variables

2002-10-02 Thread Tom Rogers
Hi, Thursday, October 3, 2002, 6:06:52 AM, you wrote: AG> Hello, AG> how can I use global variables in my web portal? I have read the php AG> documentation, but it works only in the same file. AG> I want use more global variable on many php site. AG> For example: AG> In login.php I use the code

Re: [PHP] Global variables

2002-10-02 Thread Peter J. Schoenster
On 2 Oct 2002 at 22:06, Anna Gyor wrote: > how can I use global variables in my web portal? I have read the php > documentation, but it works only in the same file. I want use more > global variable on many php site. > > For example: > In login.php I use the code > > $first=mysql_resul

RE: [PHP] Global variables

2002-10-02 Thread John W. Holmes
> how can I use global variables in my web portal? I have read the php > documentation, but it works only in the same file. > I want use more global variable on many php site. > > For example: > In login.php I use the code > > $first=mysql_result($result,0,"FIRST_NAME"); > > and I want

Re: [PHP] global variables inside of a function

2002-06-21 Thread Mark McCulligh
I tried using $_SERVER['PHP_SELF'] and $HTTP_SERVER_VARS['PHP_SELF'] but got the same error. I found the answer on www.php.net. function blah() { global $PHP_SELF; echo $PHP_SELF; } Thanks for your help, Mark. -- > > On Friday, June 21, 2002, at 09:23 AM, Mark McCulligh wrote: > > >

Re: [PHP] global variables inside of a function

2002-06-21 Thread Erik Price
On Friday, June 21, 2002, at 09:23 AM, Mark McCulligh wrote: > Is there a way to access a session variables or server variables from > inside > a function? > > I have a function and was trying to use $PHP_SELF inside of it. > I get a variable undefined error. > Out side of the function it work

Re: [PHP] global variables without sessions on apache

2002-06-06 Thread Zac Hillier
Thanks Jason, Works great in htaccess Zac - Original Message - From: "Jason Wong" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 06, 2002 4:08 AM Subject: Re: [PHP] global variables without sessions on apache > On Thursday 06 June 2002

Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Jason Wong
On Thursday 06 June 2002 06:05, Zac Hillier wrote: > Miguel, > > I mean that the variables will never change per Virtual host but that the > site is a template for many sites and these vars are part of the > distinction for each site / Virtual Host. > > So far the suggestions of using the auto-pr

Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Zac Hillier
day, June 05, 2002 7:12 PM Subject: Re: [PHP] global variables without sessions on apache > On Wed, 5 Jun 2002, Zac Hillier wrote: > > Is it possible using php on our own apache server to create global > > variables for virtual host without having to use session variables. > >

Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Miguel Cruz
On Wed, 5 Jun 2002, Zac Hillier wrote: > Is it possible using php on our own apache server to create global > variables for virtual host without having to use session variables. > > We would like to have three variables that are constant for each virtual > host and that are available from every p

Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Jason Wong
On Wednesday 05 June 2002 22:45, Zac Hillier wrote: > Could you expand on this a little more? I've tried searching for > auto-prepend in both php documentation and apache and cannot find anything > thats relates to our needs. In php.ini there is a setting called "auto_prepend_file". Set it to wh

Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Zac Hillier
To: <[EMAIL PROTECTED]> Sent: Wednesday, June 05, 2002 2:46 PM Subject: Re: [PHP] global variables without sessions on apache > On Wednesday 05 June 2002 20:40, Zac Hillier wrote: > > Hi, > > > > Is it possible using php on our own apache server to create global > > va

Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Justin French
I'm not sure about at a htaccess level, but at a php.ini level I believe you can set a file to "always include" at the top of every php page. This file could simply be: Not sure on the specifics, but it was discussed on the list in the last two weeks, and i'm sure there is documentation for th

Re: [PHP] global variables without sessions on apache

2002-06-05 Thread Jason Wong
On Wednesday 05 June 2002 20:40, Zac Hillier wrote: > Hi, > > Is it possible using php on our own apache server to create global > variables for virtual host without having to use session variables. > > We would like to have three variables that are constant for each virtual > host and that are av

Re: [PHP] Global variables

2002-05-30 Thread Ed Gorski
use a database ed At 04:35 PM 5/29/2002 +0300, serge gedeon wrote: >Dear sir, > >I would like to know if I could create using PHP, global variables that I >could use in diferrent files. I don't want to use http_get_vars or post or >cookies is there an other way? > >Thank you. >Serge GEDEON

RE: [PHP] Global variables

2002-05-30 Thread John Holmes
Sounds like a job for $_SESSION to me... http://www.php.net/manual/en/ref.session.php ---John Holmes... > -Original Message- > From: serge gedeon [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 29, 2002 9:36 AM > To: [EMAIL PROTECTED] > Subject: [PHP] Global variables > > Dear sir, >

RE: [PHP] Global variables

2002-05-30 Thread James Holden
Look at the auto-prepend or auto-append feature. -Original Message- From: serge gedeon [mailto:[EMAIL PROTECTED]] Sent: 29 May 2002 14:35 To: [EMAIL PROTECTED] Subject: [PHP] Global variables Dear sir, I would like to know if I could create using PHP, global variables that I could use

Re: [PHP] global variables

2002-05-05 Thread Austin Marshall
Jule wrote: > Hey, > i'm just wondering if there is another way to write global variables to a > global.php, now i just the whole fopen etc script, where i open a file and > write the sctring $number_right = [whatever number it is] to the file, but is > there a different way to write it to the

RE: [PHP] global variables

2002-05-04 Thread John Holmes
This is simpler than cookies?? Anyway, that's how you have to do it. Fopen(), fwrite(), fclose()...not any way simpler that I know of. ---John Holmes... > -Original Message- > From: Jule [mailto:[EMAIL PROTECTED]] > Sent: Saturday, May 04, 2002 6:23 PM > To: [EMAIL PROTECTED] > Subject:

Re: [PHP] global variables

2001-09-24 Thread Philip Olson
$bar = 'abc'; function foo() { global $bar; $bar = 'def'; } foo(); echo $bar; // def http://www.php.net/manual/en/language.variables.scope.php regards, Philip Olson On Tue, 25 Sep 2001, Peter wrote: > Hi, > > I am have a function in which I have created a variable in it called

RE: [PHP] global variables

2001-09-24 Thread Rodino, Justin
global $genpasswd; ___ Justin Bain Rodino Technology Analyst/Systems Engineer p. 219.524.1000 f. 219.524.1001 e. [EMAIL PROTECTED] > -Original Message- > From: Peter [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 24, 2001 1:28 PM > To: PHP List

Re: [PHP] Global Variables -> Local Scope

2001-07-29 Thread Brian White
Well, you could try: extract( $GLOBALS ) inside a function - that might work.. At 22:14 26/07/2001 -0400, [EMAIL PROTECTED] wrote: >How can I read in all of the global variables and give them local >scope? PLEASE HELP ME. > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscrib

Re: [PHP] Global Variables -- why not have them?

2001-07-08 Thread mike cullerton
on 7/8/01 7:57 PM, Brian White at [EMAIL PROTECTED] wrote: >>> I dislike the GLOBAL statement in that many of the bugs that get me >>> scratching my >>> head are to do with when I have forgotten to use it. >> >> Then you're probably using it way too often. > > It is usually for "SCRIPT_NAME", o

Re: [PHP] Global Variables -- why not have them?

2001-07-08 Thread Brian White
At 20:13 8/07/2001 -0500, Mark Charette wrote: > > I dislike the GLOBAL statement in that many of the bugs that get me > > scratching my > > head are to do with when I have forgotten to use it. > >Then you're probably using it way too often. It is usually for "SCRIPT_NAME", or one of the CGI para

Re: [PHP] Global Variables -- why not have them?

2001-07-08 Thread Mark Charette
> I dislike the GLOBAL statement in that many of the bugs that get me > scratching my > head are to do with when I have forgotten to use it. Then you're probably using it way too often. Global scope variable are inherently dangerous and cause more problems than they're worth. I've been in this b

Re: [PHP] Global Variables -- why not have them?

2001-07-08 Thread teo
Hi Inércia! On Sun, 08 Jul 2001, Inércia Sensorial wrote: > > You must learn it's way if you want to be effective. Also take a > > look at design features proposed for PHP5. Looks promising and more C++ > like, > > so better compare it with the later one. > > I went to php.net and searched for

Re: [PHP] Global Variables -- why not have them?

2001-07-08 Thread Inércia Sensorial
> You must learn it's way if you want to be effective. Also take a > look at design features proposed for PHP5. Looks promising and more C++ like, > so better compare it with the later one. I went to php.net and searched for some kind of docs on PHP5, but found not a word. Where can I see this

Re: [PHP] Global Variables -- why not have them?

2001-07-07 Thread John Meyer
At 02:55 PM 7/7/01 -0400, Mitch Vincent wrote: > I've been using PHP for several years now and one question has plagued >me the entire time. Why doesn't PHP have global variables? Before someone >says it, I do know PHP sort of does have global variables, but having to >specify GLOBAL in any fu

Re: [PHP] Global variables? (unset/set or what?)

2001-05-19 Thread Richard
So this will do then: $GLOBALS["userPassword"] = "whatever"; And when I need to use it, I use echo userPassword; and such alike? What if I would like to change it? Can I simply use 'userPassword="whatever"'; ? Thanks, Richard -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Global variables? (unset/set or what?)

2001-05-19 Thread CC Zona
In article <9e6s21$2rk$[EMAIL PROTECTED]>, [EMAIL PROTECTED] ("Richard") wrote: > So i should start the header (or wherever in the header) with : > > $GLOBALS["userPassword"] = "whatever"; > > function cp() { > global $userPassword; > > // $userPassword is 'whatever' /

Re: [PHP] Global variables? (unset/set or what?)

2001-05-19 Thread Richard
So i should start the header (or wherever in the header) with : $GLOBALS["userPassword"] = "whatever"; function cp() { global $userPassword; // $userPassword is 'whatever' // } Did I get it or am I just too tired? - Richard "Michael Stearne" <[EMAIL PROTECTED]> w

Re: [PHP] Global variables? (unset/set or what?)

2001-05-19 Thread Michael Stearne
Try the define function. That will define a constant that you will always have access to (within functions, through various included files,etc.) Or you can write values to the $GLOBALS array of global variables. $GLOBALS["userPassword"]="u8943fd"; Will define a variable that is accessible as $

Re: [PHP] Global variables

2001-04-19 Thread Ulf Wendel
Aaron Tuller schrieb: > > At 1:16 AM + 4/19/01, Philip Olson wrote: > > > > > > > > don't do that, at least I think it will recursively traverse the > $GLOBALS arrary (since $GLOBALS itself is $GLOBAL) and you will never > end. print_r() does have that bug, not var_dump(). http

Re: [PHP] Global variables

2001-04-18 Thread Philip Olson
> At 1:16 AM + 4/19/01, Philip Olson wrote: > > > > > > > > don't do that, at least I think it will recursively traverse the > $GLOBALS arrary (since $GLOBALS itself is $GLOBAL) and you will never > end. This is true with print_r($GLOBALS) up until 4.0.4 where it was fixed, whi

Re: [PHP] Global variables

2001-04-18 Thread Aaron Tuller
At 1:16 AM + 4/19/01, Philip Olson wrote: > > > don't do that, at least I think it will recursively traverse the $GLOBALS arrary (since $GLOBALS itself is $GLOBAL) and you will never end. -aaron -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL P

Re: [PHP] Global variables

2001-04-18 Thread Philip Olson
Have a look at the enormous $GLOBALS array, something like : As previously mentioned, phpinfo() provides some pretty information and it may be more what you want. Regarding $GLOBALS, (as quoted from the manual) : "The $GLOBALS array is an associative array with the name of the gl

RE: [PHP] Global variables

2001-04-18 Thread Jason Murray
> I know there is a way to do it in Perl, but is there anyway > in PHP to display all of the global variables. Such as OS, > browser, date/time, that sort of thing > > I know I could print each one seperately, but are they all > stored in an array somewhere? That should show you everything

Re: [PHP] Global Variables

2001-04-03 Thread Renze Munnik
Jon wrote: > > Hi, > > I need to retrieve some information from a database, asociated with the user > session so I could query this information whenever I want through the user > session. I am searching for something similar to ASPs global variables if > there is anything equivalent with PHP. >

Re: [PHP] Global variables - please explain me someone.

2001-02-23 Thread Christian Reiniger
On Friday 23 February 2001 08:50, Dezider Góra wrote: Disclaimer: I have never touched ASP, so I'm likely to have gotten somethings wrong.. > function too ). But in asp, there were couple types or scopes. > Asp got "application" and "session". Application is something like a > virtual directory