Jump to content

cannot get all POST values


amalafrida

Recommended Posts

Trying to POST values from a table ... each table cell represents 1 hour of each day for 6 months ... total approx. 4000

 

the cells are named datacell[0] ... datacell[4000]

 

however, when i

            foreach($_POST['datacell'] as $key=>$val)
            {
                $codes.=$val;
            }
echo strlen($codes);

 

strlen is only 1001 ... same if I push them into an array

 

any suggestions?

 

beginning to think I have reached an unwieldy limit here ...

 

break the calendar up ... present only one month at a time?

Link to comment
Share on other sites

Are the form elements checkboxes? A table cell is not a form element that would have a name, it's going to be an input with a type. If the type is checkbox, the value isn't sent in the post array when it's not checked.

Link to comment
Share on other sites

I don't understand your "timestamp/column" comment.

 

The first cell of each row carries a timestamp.

 

a typical row resembles the following:

 

<td> <input type='text' name='date[1345438800]' value='Mon-20-Aug' /></td>

<td> <input type='text' name='datacell[0]' value='Z' /> </td>
....
<td> <input type='text' name='datacell[23]' value='A' /> </td>

 

I'm looping through and picking up each day's sequence of 24 values and placing them into an array ...

key=timestamp

value=24 letter codes ...

then to the database with it ...

 

user is free to modify any of the available text boxes.

Link to comment
Share on other sites

According to your post, you have a series of cells representing a series of points in time. This is not an optimal way to solve a problem. Time isn't a description of the data, it is the data itself. Not to mention how much more difficult it becomes to actually retrieve the data associated with those points in time, as you now have to loop through tens of thousands of fields, instead of just one row per data point with some actual data.

 

To show what I mean in code, instead of using something like this:

day, user, time_1, time_2, time_3, time_4, time_6.... (And so forth)

You should be using something like this:

user, time, event

 

As you see, not only does this describe the data a lot better, but you only have three fields to work with. In addition to that, they all three contain data all of the time, unlike the first example.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.