Array Passing from html

Discussion in 'PHP' started by shiva_rnm, Jul 8, 2008.

  1. #1
    Hi ,

    I want to know how can i pass html array value as a parameter to another page.

    I've wrote this code but didnt work,

    $my_array1 = array('s','d','f');
    foreach ($my_array1 as $key => $value)
    {
    echo '<input type=hidden name="my_array[]" value="'.htmlspecialchars($value).'">';
    }
    echo "<a href='Simple?action1=delete&filename=".$my_array[1]."'>Link <a>";
     
    shiva_rnm, Jul 8, 2008 IP
  2. Danltn

    Danltn Well-Known Member

    Messages:
    679
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    120
    #2
    I don't see what's wrong with sessions, but you could serialize the data, or even use http_build_query

    Dan
     
    Danltn, Jul 8, 2008 IP
  3. JLEville

    JLEville Peon

    Messages:
    147
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Cookies, sessions, get/post variables. Any of these would work.
     
    JLEville, Jul 8, 2008 IP
  4. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    #4
    donot need to pass whole html just pass only values

    check first if array thing is working

    When u load the page how many hidden controls you see and what values

    Regards

    Alex
     
    kmap, Jul 8, 2008 IP
  5. shiva_rnm

    shiva_rnm Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi all , thanks for reply...

    I've input textbox's displayed in a table.
    the user can select any row and update that row in textbox and click the link <a> to update.
    the input textbox's displyed in a arrray.

    my problem is i need to pass the updated value from row textbox's to other page.
     
    shiva_rnm, Jul 8, 2008 IP