Results 1 to 8 of 8

Thread: All the $_POST variables in an array

  1. #1

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    All the $_POST variables in an array

    I'm passing about 125 million values from page1.php to page2.php, using the POST method.

    I'm sure there's probably an environmental variable or array that stores all these values together. Can you tell me which one, and how to work with it?

    TIA.

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    125 million varaibles? man what a waste

    print_r($_POST);

    that will print out ever single one......

  3. #3

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Well, not 125 million.. I was being rhetorical, I think.

    I just meant 'a lot of values,' and instad of doing a

    $varname = $_POST['varname'];

    for each value passed, I wanted to work with the environmental variables.

    print_r() prints it all out. Can't I get access the array?

  4. #4
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    well you could do it like this

    PHP Code:
    foreach ($_POST as $key => $val) {
          $
    $key $val;
      } 
    but all that does is makes all the POSTed varaibles the real names.

    so if you have a variable sent from the form like this

    $_POST['name'] and that little loop makes it so you can use it like this $name

    but you still have to know what each variable name is, nothing around that.

  5. #5

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    OK, Thanks for the info.

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I don't understand everyone's problem with using $_POST['varname'] in their code...
    My evil laugh has a squeak in it.

    kristopherwilson.com

  7. #7

    Thread Starter
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by The Hobo
    I don't understand everyone's problem with using $_POST['varname'] in their code...
    I'm doing better than that! I'm trying to get the code to do all the $_POSTing for me!

  8. #8
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Uh huh.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width