Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Location
    India
    Posts
    168

    Unanswered: Passing arrays from form

    Hi,
    Let me first lett u all about what am i doing and what i need.
    I have a list of items which can be selected by a check box (For Multiple selection). Now I need this to be displyed on the next page where ever I submit the page. This tast is simple and work very well for me if my register_global is on. ie
    foreach($arr as $value)
    {
    echo "Items : $values<br>";
    }
    But when I use this with register_global =off this give me an error saying "Invalid argument supplied for foreach()".
    How will i initialize this variable in this page. I cannot use $HTTP_POST_VARs['arr']....
    So what should I try with. I cannot turn on the register_global. It is not working. I tried doing this and restarted apache but was unsuccessful.

    Any help will be appriciated

    Thanks in advance
    Regards
    Rajesh

  2. #2
    Join Date
    Apr 2004
    Posts
    16
    well I'm not sure if this will get you by w/o reg. globals or not - I don' think that I have reg. globals enabled but this works for me:
    foreach ($_POST as $key => $value){
    echo $key." = ".$value;
    }

    or something similar.

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    168

    Smile

    I got this working. There was a problem with my php.ini file and I have fixe it.
    This is working with $_POST['arr']

    Thank You

    Regards

    Rajesh

Posting Permissions

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