The user's choice is made from a drop down list of available items, prior to running the routine itself. The choices are predetermined and kept in a personal table to be called by the routine. This part is finished to the point of putting the needed column names at the top of the input columns on the form. The choices are fixed spellings to match formula if-then's, etc. The use is for data manipulation and so proper tracking of name/data is important in that regard, but the final output figures go to the same categories in all cases so those tables are fixed.
The personal list table is to be called on the action page for keeping the arrays in their proper order and usage. The original idea was that the list would be used somehow for creating the required $_request's etc. But as you say, the tricky part is the naming of the columns, as we do with the 'basic' column arrays. I don't know if this can be done. Thought it might be possible with 'dot' adds of functions or some such to command lines built on the fly but haven't been able to make it happen. But putting together what you and others are saying is giving me good thoughts. :-) Although I am still not sure how to code all of this, much less express it, I am getting the idea that all 'columns' would have the same array name and that the position of the data within that single array will be the determining factor as to where it is applied. That is if we need 3 user columns and 4 rows we will end up with a single array of 12 values... The three columns' fields would be arranged as 1-4-7-10, 2-5-8-11 and 3-6-9-12. That should work nicely. The column name list determines the number of fields per row and the rest is automatic. Perhaps I was going off the deep end before but this method seems much less involved. Anyone see a problem with doing it this way? Many thanks to all and I apologize for the verbosity. Floyd On Thu, 28 Nov 2002 01:28:48 -0800, you wrote: >Floyd, >I thought about this some and started noodling out a solution for you, but >have a few questions before I go any farther on this. >1. The part about users inputting their own column headers is relatively >straight forward. Something like this should work: > ><?php >if (!isset($start_button)) > { > print "<form action=$PHP_SELF method=get>"; > print "Input the following information"; > // these are your fixed cells > print "Name: <input type=text name=name size=20><br>"; > print "Temp: <input type=text name=temp size=20><br>"; > print "Time: <input type=text name=time size=20><br>"; > print "Offset: <input type=text name=offset size=20><br>"; > // User inputs the number of additional cells needed > print "Input number of additional cells needed: <input type=text > name=additional_cells size=20><br>"; > print "<input type=hidden name=start_button value=1>"; > print "<input type=submit value=\" Hit it! \">"; > print "</form>"; > } >if ($start_button=="1") > { > print "<form action=$PHP_SELF method=get>"; > print "Input the following information"; > // these are your fixed cells and they now contain user input > print "Name: <input type=text name=name value=\"$name\" size=20><br>"; > print "Temp: <input type=text name=temp value=\"$temp\" size=20><br>"; > print "Time: <input type=text name=time value=\"$time\" size=20><br>"; > print "Offset: <input type=text name=offset value=\$offset\" >size=20><br>"; > print "Input the names of the desired additional cells in the spaces >provided."; > // this is where your user will name the cells he asked to create > for($i=1;$i<=$additional_cells;$i++) > { > print "$i <input type=text name=user_added[$i] size=20><br>"; > } > print "<input type=hidden name=additional_cells value=\"$additional_cells\" >>"; > print "<input type=hidden name=start_button value=2>"; > print "<input type=submit value=\" Hit it! \">"; > print "</form>"; > } >if ($start_button=="2") > { > print $name."<br>".$temp."<br>".$time."<br>".$offset."<br>"; > for($i=1;$i<=$additional_cells;$i++) > { > print "user cell ".$i." ".$user_added[$i]."<br>"; > } >} >?> > > >2. Now comes the tricky part, and the part I'm unsure about. You can >convert the user input in the above so that it becomes the names of the >input cells, or you can leave them in a numeric array. Leaving them in a >numeric array will be easier to deal with later. >Also, other than the display of a table, what do you want the user input >for? If you're planning on doing any data manipulation, then your coding >will get a bit hairy because you won't know what relation the user input >data has to your standard data (name, time, temp and offset). Finally, if >you're planning on storing the data in a database table, each table will >need to be created on the fly--it can be done, but if you're struggling with >this, it'll take you some time to get the back end working. > >Hope this helps, >Hugh > >----- Original Message ----- >From: "Floyd Baker" <[EMAIL PROTECTED]> >To: <[EMAIL PROTECTED]> >Cc: "'Hugh Danaher'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> >Sent: Wednesday, November 27, 2002 5:24 PM >Subject: Re: [PHP] dynamic arraynames > > >> >> >> Well I might be in the wrong place. I've also asked in the HTML list >> now too but I'm still stuck and need some help. >> >> This is pretty much as clear as I can make it. I'm up against a >> mental block and even if it's as clear as glass to others I'm dead in >> the water and would appreciate some pointers. I have a bunch of >> pieces but can't seem to string them together enough to make it work. >> >> Just trying to build an x-y array of data input fields and then send >> them recursive to be used further down the program. >> >> I can do this fine with a fixed number of columns and rows of user >> input but I cannot figure out how to make this happen using a variable >> number of columns. I'm a complete array amateur and would appreciate >> a little assistance... >> >> I want it to look something like this: >> >> Name Temp Time Offset Etc. As needed... >> process 1 [input] [input] [input] [input] [inputs] >> process 2 [input] [input] [input] [input] [inputs] >> process 3 [input] [input] [input] [input] [inputs] >> process 4 [input] [input] [input] [input] [inputs] >> >> Right now, for the three *basic* columns, I have the lines below in a >> 'while' loop. >> >> <INPUT TYPE='text' NAME='temp[]' VALUE='$temp' SIZE='10' >> MAXLENGTH='10'> >> <INPUT TYPE='text' NAME='time[]' VALUE='$time' SIZE='10' >> MAXLENGTH='10'> >> <INPUT TYPE='text' NAME='offs[]' VALUE='$offs' SIZE='10' >> MAXLENGTH='10'> >> >> But when it comes to adding additional columns that a user >> determines are needed, I am lost. Users might want to add 0, or 4, or >> 10 additional items... I would like only that number of usable >> input columns be on the input-form, identified for what they contain, >> and then be passed to the next page.... >> >> Again, many thanks in advance. >> >> Floyd >> >> >> >> >> >> >> On Sun, 24 Nov 2002 23:55:56 -0500, you wrote: >> >> >I'm sorry, but I'm still confused. Can you show us a sample of the data >> >in the database and what you want the resulting form to look like for >> >that data? Maybe that'll help. >> > >> >---John Holmes... >> >> >> >> >> >> -- >> -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php