On Tuesday 16 March 2004 16:04, Alvaro Zuniga spake:
> Just read my on message, you also need
>
> $GLOBAL_VARS_FIX = true
>
> that is so you can turn it on and off depending on the php setup of the
> site.
>
> On Tue, 2004-03-16 at 15:56, Alvaro Zuniga wrote:
> > Hi Joey:
> > This is a fix that you can include in every script that needs it. See
> > also comments below.
> >
> > if($GLOBAL_VARS_FIX) {
> >    if (phpversion() >= "4.2.0") {
> >       extract($_POST);
> >       extract($_GET);
> >       extract($_SERVER);
> >       extract($_ENV);
> >       extract($_COOKIE);
> >    }
> > }
> >

What the problem ended up being was bad syntax (notice the variable 
$materials):

> In your source, change line 13 from
>
> $materials["quantity"][1] = $_POST[$materials]["quantity"][1];
>
> to:
>
> $materials["quantity"][1] = $_POST["materials"]["quantity"][1];

Kevin Kreamer on the nolug list spotted my error.

Regarding your suggestion:

Actually, I wrote^Wstole a wrapper for all of my $_POST variables. It's not 
finished (I want to do more error-checking, etc.):

# This function grabs POST variables and cleans them up a bit
# It's not complete yet --- I need to do more research, etc..
#
# Adapted by:
# Joey kelly, [EMAIL PROTECTED]
#
# To-do:
# get rid of bad characters, along with backslashes, after EscapeShellCmd()
#
# error codes?
#
function getpostvars($postvar, $maxlength) {
  $postvar = $_POST[$postvar];
  $postvar = EscapeShellCmd($postvar);
  $postvar = substr($postvar, 0, $maxlength);
  return($postvar);
}



<snip>

-- 


Joey Kelly
< Minister of the Gospel | Linux Consultant >
http://joeykelly.net


"I may have invented it, but Bill made it famous."
 --- David Bradley, the IBM employee that invented CTRL-ALT-DEL

Reply via email to