Page 2 of 2

Posted: Thu Sep 16, 2004 6:18 am
by dethron
Well what are those other-advantages then?
I really wonder this whole register_global branch
If you have a detailed paper about them, plz share it..

Posted: Thu Sep 16, 2004 6:36 am
by John Cartwright
[big_search]register_globals[/big_search]

Posted: Thu Sep 16, 2004 6:41 am
by dethron
good work ;)

Posted: Thu Sep 16, 2004 11:10 am
by feyd
I'd recommend not using $_REQUEST, because it's a merger of $_GET, $_POST and $_COOKIE. The problem lies in what order the elements get set in, which can vary from installation to installation.

If you want to support such a mechanism, I'd suggest rolling your own version so you know the order of creation.

Posted: Thu Sep 16, 2004 11:11 am
by dethron
hmm, it sounds interesting, lets roll ours.
how can we do it?

Posted: Thu Sep 16, 2004 11:36 am
by feyd

Code: Select all

function getRequest()
{
  $vars_to_pull_from = array('_GET' , '_POST');
  reset($vars_to_pull_from);
  $output = array();
  while(list(,$var) = each($vars_to_pull_from))
  {
    reset($$var);
    while(list($k,$v) = each($$var))
      if(!isset($output[$k])) $output[$k] = $v;
  }
  return $output;
}
or similar...

the order you want the data is how $vars_to_pull_from is set up. So, if you want $_POST vars set first, you set it first in the array and so on..

Posted: Thu Sep 16, 2004 11:41 am
by dethron
hmmm good work, thanx...

Posted: Thu Sep 16, 2004 11:48 am
by dethron
Warning: Variable passed to reset() is not an array or object in c:\apache\htdocs\adven\develop\f.php on line 8
Warning: Variable passed to each() is not an array or object in c:\apache\htdocs\adven\develop\f.php on line 9
Warning: Variable passed to reset() is not an array or object in c:\apache\htdocs\adven\develop\f.php on line 8
Warning: Variable passed to each() is not an array or object in c:\apache\htdocs\adven\develop\f.php on line 9


:( i'm working on it.

Posted: Thu Sep 16, 2004 11:50 am
by feyd
you did set $vars_to_pull_from correctly, yes?

Posted: Thu Sep 16, 2004 11:53 am
by dethron
:oops: shoud i do it inside of the function or outside of it?

Posted: Thu Sep 16, 2004 11:57 am
by feyd
you can do it in either, just have to add some additional things for being done outside the function.

I could continue, but we're getting substantially offtopic. PM me, and we'll work out your details.