Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Mar 2004
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    POSTing multidimensional arrays

    when I create the following multidimensional array:

    $meetings=array();

    $meetings[$query_data['meeting_id']]=array('note' => $query_data['note'], 'meeting_date' => $query_data['meeting_date']);

    And I do need to POST it with a submit button to another page how do I do that? Tried the following it didnt work:
    <input type=hidden name=country value="<?php echo $meetings; ?>" >

    thanks,

  • #2
    Mega-ultimate member
    Join Date
    Jun 2002
    Location
    Winona, MN - The land of 10,000 lakes
    Posts
    1,855
    Thanks
    1
    Thanked 45 Times in 42 Posts
    Possibly check out implode() and explode() ???

  • #3
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i think you indeed need to drag it along as a string so you'll need the implode() to create it and the explode() to turn it back into an array, although i'm not sure at all it'll work just like that with an associated array. (I'm fairly comfident it wount work.) You'll need to do some extra processing to turn it into a string with two delimiters (one for the elements and one to devide the key and value) and to recreate the array.

    Can't you store the array in a sessionvariable ?
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html

  • #4
    New Coder
    Join Date
    Mar 2004
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts
    how would I create the array into a session variable - if it is an option its OK,

  • #5
    Regular Coder dswimboy's Avatar
    Join Date
    Nov 2003
    Location
    mostly in Ann Arbor
    Posts
    458
    Thanks
    0
    Thanked 0 Times in 0 Posts
    $_SESSION['array'] = array(15, 35, 34, 16, 29); I don't know how a multidimensional array would go, but i'm sure it is possible.
    "There is more than one way to do it."

  • #6
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yes, you just do your

    $_SESSION['newarray'] = $yourarray; // doesn't realy matter if it's an associate or mutidiminsional.

    To proces it, best first have a

    $myarray = $_SESSION['newarray'] ;
    ... your processingcode
    $_SESSION['newarray'] = $myarray ;
    Posting guidelines I use to see if I will spend time to answer your question : http://www.catb.org/~esr/faqs/smart-questions.html


  •  

    Posting Permissions

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