I've got a CGI flat file program that I'm working on. Here's my problem:
I've got a flat file database (| deliminated) that is in the following format:
stuff|morestuff|other|different|1
stuff|morestuff|other|different|3
stuff|morestuff|other|different|2
The last field is a sorting number. I need to make it so a user could arbitrarily choose which lines go where. I've set it up something like this:
For some reason this won't display forms, so here's the html
<FORM>
<TABLE WIDTH="400">
<TR>
<TD><INPUT TYPE="text" SIZE=3 value="3"></TD>
<TD>Stuff</TD>
<TD>More Stuff</TD>
</TR>
<TR>
<TD><INPUT TYPE="text" SIZE=3 value="1"></TD>
<TD>Stuff</TD>
<TD>More Stuff</TD>
</TR>
<TR>
<TD><INPUT TYPE="text" SIZE=3 value="2"></TD>
<TD>Stuff</TD>
<TD>More Stuff</TD>
</TR>
</TABLE>
</FORM>
The user numbers the lines and I need the script to take those numbers, apply them to the proper part of the database, then sort the database based on those values. I've got the sort routine down if the numbers are already there, but I need to know how to set them with something like the above table so the user can change them. Does anyone have some ideas for doing this? Am I being clear enough? If not, please let me know and I'll try to clarify. Thanks!
Stamp_Guy
A bus station is where a bus stops... A train station is where a train stops... On my desk is a workstation...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.