vorteks has asked for the wisdom of the Perl Monks concerning the following question:

Could someone shed some light on something that's beyond me please?

I'm working on a database that displays repair details of work being undertaken.
The search/display of the database is done and works fine but what I need to do is have a link from the 1st field of each repair shown and have a java? popup to display further details of the same repair.

I.E. a search is done on every repair number matching 555 and 50 results are displayed from number 55500-55550 with short details of the repair in another field to the right.
How do I add a link to execute another script with a coresponding value of, say 55500 (depending on the number selected)?
I'm using a flat-file pipe delimited database.
I'm OK with doing everything but the link submission with the coresponding value.
I'm also useless at explaining stuff but I hope you get the general idea.

Replies are listed 'Best First'.
Re: Database links
by DamnDirtyApe (Curate) on Aug 08, 2002 at 18:17 UTC

    Unfortunately, with only a high-level problem description, we can only really give you high-level answers. However:

    1. Use Javascript to create your popup window.
    2. Have a script to display the information for a specific work order in that window.
    3. Generate links to that script with the work order identifier in the URL. Something like:
      http://www.example.com/showworkorder.pl?work_id=55500
      Use that work order ID in your SQL query.
    HTH
    _______________
    DamnDirtyApe
    Those who know that they are profound strive for clarity. Those who
    would like to seem profound to the crowd strive for obscurity.
                --Friedrich Nietzsche
      OK
      Here's an update to make things clearer.
      I've managed to do some coding for what I need but I'm stuck at the crucial part

      @table_fields = "field1","field2","field3","field4"); foreach $table_fields (@table_fields) {print"<th bgcolor=#7777CC><font color=#000000><font s +ize=\"-1\">$table_fields</th>\n";} print"</tr>\n"; open (DATABASE, "$database"); while ($inLine = <DATABASE>) { $line=$inLine; { @fields = split(/\|/,$line); {print"<td bgcolor=$bgclr><font size=\"-2\">$fields[6] +</td>\n";} {print"<td bgcolor=$bgclr><font size=\"-2\">$fields[8] +</td>\n";} {print"<td bgcolor=$bgclr><font size=\"-2\">$fields[0] +<a href=http://domain.com/cgi-bin/query_call.cgi?$fields[0]><img src= +../images/red.gif></td>\n";}
      The rest is irrelevant as what I need to know is the correct format to make the text of $fields[0] in the last line THE submission instead of red.gif and preferably without an image.

        Eh? You want to make your anchor display the text of $fields[0], rather than displaying a gif?

        print "<a href=whatever>$field[0]</a>";

        Although, in general, you ought to have a look at using some module (CGI being the usual one) to handle this, as you'll be in trouble if $field[0] happens to contain any HTML specific characters (such as <). From your description of your data, you'll be ok in this case, but use CGI; is a good habit to get into.

        --
        Tommy
        Too stupid to live.
        Too stubborn to die.