SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Feb 2001
    Location
    Shanghai, China
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    arrays in hidden field

    Hi all.
    I have a form where user can tick in which teams they are and save this in an array like here:
    PHP Code:
    <input type="checkbox" name="teams[]" value="$teamid"
    now if something else in the form is missing (for example his name ) I send the user to another form where I give him another chance to fill it out ( but I will not show him all the teams again ) , but I will pass all the other staff via hidden fields. But how can I pass the array with the teams in a hidden field ?
    This here :
    PHP Code:
    <input type="hidden" name"teams[]" value="$teams"
    does not work.
    Thanks for your help.

  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use serialize():
    http://www.php.net/manual/en/function.serialize.php

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    SitePoint Addict
    Join Date
    Feb 2001
    Location
    Shanghai, China
    Posts
    214
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool thanx. Alex


Bookmarks

Posting Permissions

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