AW: Need help with HTML form errors

"Sascha Meyer" <[email protected]>
Newsgroups gmane.comp.php.windows
Message-ID <001001cb1c1e$0373abe0$0a5b03a0$@de>
Hi Nagendra,

Nagendra wrote:
> So, What if I define the same global variable twice, will this solve the
> issue?

No, this will most likely overwrite the values from the variables defined
outside of the routine.
I'll try to illustrate this a bit.

[CODE]
<?php
// WON'T WORK
// variables defined and set outside of the function
$filter = "123";
$filterfield = "ID";

function form_fill ()
{
  // both variables will be reinitialized with false and the values from the
outside scope will be discarded
  $filter;
  $filterfield;
}
[/CODE]

[CODE]
<?php
// WILL WORK
// variables defined and set outside of the function
$filter = "123";
$filterfield = "ID";

function form_fill ()
{
  // both variables are declared as being defined outside of the function
(global scope)
  global $filter, $filterfield;
}
[/CODE]

Did you do it like in the above example 2?

Regards, 

Sascha



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.