in reply to Re: Database links
in thread Database links

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.

Replies are listed 'Best First'.
Re: Re: Database links
by tommyw (Hermit) on Aug 08, 2002 at 21:48 UTC

    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.

      OOPS...
      I meant
      {print"<td bgcolor=$bgclr><font size=\"-2\"><a href=http://www.whatever.com/cgi-bin/query_call.cgi?call=$fields[0]>$fields[0]</a></td>\n";}