Re: [PHP] Variable scope

2011-07-14 Thread Tamara Temple
On Jul 14, 2011, at 3:54 PM, Karl DeSaulniers wrote: Can anyone explain this to me. function sendEmail($uname,$subjField,$firstname,$lastname,$email, $reply,$e_cc,$e_bcc,$comments,$ip,$Date,$time){ $uname = trim($uname); $subjField = trim($subjField); $firstname = trim($firstname);

[PHP] SOLVED Re: [PHP] Variable Scope problem passing function parameters

2008-12-18 Thread Jim McIntyre
Jim McIntyre wrote: metastable wrote: Jim McIntyre wrote: $phpMail = new PHPMailer(); $phpMail->From = $from; $phpMail->AddAddress($this->to); $phpMail->Subject = $subject; $phpMail->Body = $body; return $phpMail->Send(); Never mind - I found the problem. It was a lo

Re: [PHP] Variable Scope problem passing function parameters

2008-12-18 Thread Jim McIntyre
metastable wrote: Jim McIntyre wrote: $phpMail = new PHPMailer(); $phpMail->From = $from; $phpMail->AddAddress($this->to); $phpMail->Subject = $subject; $phpMail->Body = $body; return $phpMail->Send(); $this -> to it has no meaning in the scope of your class. Appare

Re: [PHP] Variable Scope problem passing function parameters

2008-12-18 Thread metastable
Jim McIntyre wrote: > I'm new to PHP 5 and classes, but I've done a lot of ActionScript. > > I'm trying to use PHPMailer inside my own class (a service for > AMFPHP). I'm having problems getting the data that'spassed into my > class's send() method to the instance of the PHPMailer. > > Basically, I

Re: [PHP] Variable Scope from child to parent

2008-05-15 Thread Andrew Ballard
Ok, I forgot to reply-all to the list. Here we go again. On Wed, May 14, 2008 at 6:33 PM, Tyson Vanover <[EMAIL PROTECTED]> wrote: > I am trying to get a child class to pass an array of valid keys to it's > parent when the constructor is run, and the parent appends the data to one >> of it's array

Re: [PHP] Variable Scope from child to parent

2008-05-14 Thread Gabriel Sosa
tyson i never saw self::$this->vkeys doing this you actually are callig the var inside $this->vkeys do self::$vkeys as static or $this->vkeys as object don't mix regards On Wed, May 14, 2008 at 7:33 PM, Tyson Vanover <[EMAIL PROTECTED]> wrote: > I am trying to get a child class to pass an ar

Re: [PHP] Variable scope

2002-05-04 Thread Miguel Cruz
On Thu, 14 Mar 2002, George Nicolae wrote: >> > > > function a($var_a) >> > { >> > b(); >> > } >> > >> > function b() >> > { >> > global $var_a; >> > echo $var_a; >> > } >> > >> > a("hello word!"); >> > ?> >> > >> > why function b() don't echo anything? >> >> Because $var_a has not, at any point,

Re: [PHP] Variable scope

2002-05-04 Thread Jason Wong
On Friday 15 March 2002 00:34, George Nicolae wrote: > "Jason Wong" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED]... > > > On Thursday 14 March 2002 21:53, George Nicolae wrote: > > > I have the following code: > > > > > > > > function a($var_a) > > > { > > > b(); > > > } > > > >

Re: [PHP] Variable scope

2002-05-04 Thread George Nicolae
"Jason Wong" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]... > On Thursday 14 March 2002 21:53, George Nicolae wrote: > > I have the following code: > > > > > function a($var_a) > > { > > b(); > > } > > > > function b() > > { > > global $var_a; > > echo $var_a; > > } > > > > a("he

Re: [PHP] Variable scope

2002-05-04 Thread Jason Wong
On Thursday 14 March 2002 21:53, George Nicolae wrote: > I have the following code: > > function a($var_a) > { > b(); > } > > function b() > { > global $var_a; > echo $var_a; > } > > a("hello word!"); > ?> > > why function b() don't echo anything? Because $var_a has not, at any point, been defi

Re: [PHP] variable scope

2002-03-12 Thread David Johansen
Something most have just been wigging out or something because I can't get it to do it again. Maybe I just did something wrong, but it seems to be working now. Thanks for the help though, Dave "Lars Torben Wilson" <[EMAIL PROTECTED]> wrote in message 1015973063.2146.82.camel@ali">news:1015973063.

Re: [PHP] variable scope

2002-03-12 Thread Lars Torben Wilson
On Tue, 2002-03-12 at 14:38, David Johansen wrote: > I have a little chunk of code that checks to see if a variable exists and if > not then it sets it. It goes like this: > > if (empty($page)) > { >$page = "login"; > } > > I then end that part of the php script after doing what I need to. T

Re: [PHP] variable scope / preg_replace_callback question

2001-12-03 Thread Andrey Hristov
function _compile_lang($key){ global $_lang; return $_lang[$key[1]]; } // End _compile_lang HTH Regards, Andrey Hristov - Original Message - From: "Peter Bowyer" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 03, 2001 3:45 PM Subject: [PHP] variable scope / preg_repl

RE: [PHP] Variable scope problem

2001-03-28 Thread Jason Lotito
> -Original Message- > From: Joe Nelson [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 28, 2001 6:17 PM > To: php list > Subject: [PHP] Variable scope problem > > > I have two functions like the ones below. If the first one creates a > variable as global, shouldn't it be accesible to

RE: [PHP] Variable scope

2001-03-10 Thread Christian Joergensen
-Original Message- From: Martin Skjoldebrand [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 10, 2001 3:22 PM To: [EMAIL PROTECTED] Subject: [PHP] Variable scope > How do I make a variable persistent between webpages? Take a look at the session functions described at:

Re: [PHP] Variable Scope

2001-01-18 Thread Michael Kimsal
I find the VB way (or VBScript anyway) of doing functions backwards. My recollection is that if I call a function blah... x = blahfunction('cow') 'blahfunction' itself has to be defined *in* the function to get the value back. I can't even think of a good example, it's so foreign to me and I h

Re: [PHP] Variable Scope

2001-01-18 Thread Philip Olson
How about allowing for metaPasses within the castle? Am sure this topic came up, what's the conclusion? Philip On Thu, 18 Jan 2001, Rasmus Lerdorf wrote: > > I'm a bit troubled with the fact that variables declared at the top of your > > script are not then global to functions within that scr

Re: [PHP] Variable Scope

2001-01-18 Thread Rasmus Lerdorf
> I'm a bit troubled with the fact that variables declared at the top of your > script are not then global to functions within that script. That in order > to see that variable within a function you'd have to declare it as global in > the function (understanding that the variable could have been

Re: [PHP] Variable Scope

2001-01-18 Thread Philip Olson
A nice explanation, via the mind of Lars Torben Wilson, exists here : http://marc.theaimsgroup.com/?l=php-general&m=97717398101040&w=2 Also, you may want to check out : http://www.php.net/manual/en/language.constants.php http://www.php.net/manual/en/function.define.php Philip On T