--- Gordon Stewart <[EMAIL PROTECTED]> wrote:

> On 8/27/05, Nick Jones <[EMAIL PROTECTED]> wrote:
> > I'm trying to change the value of my $_POST
> variables
> > at the beginning of my script before I call them
> later
> > in the script, and it doesn't seem to be working.
> Here
> > is what I'm trying to do:
> > 
> > foreach($_POST as $value){
> > 
> >      if ($value == 'on'){
> > 
> >           $value = 1;
> >      }
> > }
> > 
> > But later if I call the POST variables in the
> script,
> > their value is still "on". Is there a way to
> change
> > these values at the beginning of the script before
> I
> > use them later in the script?
> 
> try  $_POST[$value] = 1;
> 
> or
>   $_POST["$value"] = 1;
> 
> Changing the value of $value - doesnt change the
> $_POST - Theyre
> seperate things.
> 
> -- 
> G Stewart
> http://e-services.kwister.com/
> NZ community groups - [EMAIL PROTECTED]

Thanks Gordon! I got it, figured it out just as you
emailed me back. Here's what I did:

foreach($_POST as $key => $value){

     if ($value == 'on'){

          $_POST[$key] = 1;
     }
}

Works like a charm now.

Thanks!
-Nick


                
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/HKFolB/TM
--------------------------------------------------------------------~-> 

Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to