SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Aug 2006
    Location
    Chicago
    Posts
    542
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Adding to an array for every form sent

    (mods, please rename the title to "Adding to an array for every form sent". I submitted the topic prematurely)

    A form I have needs to add additional items every time it gets sent. That is, building a list of items by sending it with an "add" button, and then the option of saving it to a database by a "save" button. The information sent would be added to an array, and I would want it very much to push an array value every time the form is submitted.

    I only want it to write to a database when the user chooses to save the list. But for holding "temporary" values in order to keep adding to an array, I'm stumped. The array simply resets every time the form is being sent.
    Last edited by ccRicers; Mar 20, 2007 at 20:58. Reason: Incorrect topic title

  2. #2
    SitePoint Wizard bronze trophy bigalreturns's Avatar
    Join Date
    Mar 2006
    Posts
    1,295
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You could use sessions, creating an array that you add each individual item to, then write to the db using the data from the array you're storing in the session.
    "The proper function of man is to live - not to exist."
    Get a Free TomTom



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
  •