Hi, the code below is a cgi file and I am having problems displaying the image and style from an external css file. The code is in lines 18-28 and I'm not sure what I am doing wrong. I would appreciate any help.

#!/usr/bin/perl -w use strict; use DBI; use CGI; use CGI::Carp('fatalsToBrowser'); my $query = new CGI; print $query->header(); my $my_database = "TrypSnoDB"; my $localhost = "localhost"; my $dsn = "DBI:mysql:$my_database:$localhost"; my $db_user_name = "adrian"; my $db_password = "temp_pass"; my $dbh = DBI->connect("DBI:mysql:database=TrypSnoDB;host=localhost;my +sql_socket=/private/software/mysql/mysql.sock","adrian","temp_pass", +{'RaiseError' => 1}); print "<html>\n"; print "<head>\n"; print "<title>Welcome to the T. Brucei snoRNA Database</title>\n"; print "<link type='text/css' rel='stylesheet' href='/public_html/style +.css'>\n"; print "</head>\n"; print "<body>\n"; print "<h1>Trypanosomatid snoRNA Database</h1>\n"; print "<img class='my_images' src='/public_html/tb_pic1.png'>\n"; print "</body>\n"; print "</html>\n"; if ($query->param('submit1')){ my $orig_sno = $query->param('snorna1'); my $family = $query->param('family1'); my $query_type = $query->param('target_option1'); my $target = $query->param('target_name1'); if ($orig_sno eq "Trypanosoma brucei") { $orig_sno = 1; } elsif ($orig_sno eq "Leishmania major") { $orig_sno = 7; } elsif ($orig_sno eq "ALL") { $orig_sno = "1 or ST.org_id=7"; } if ($family eq "ALL") { $family = "'C/D' or ST.family='H/ACA'"; } else { $family = "'$family'"; } if ($target ne "ALL") { $family = "$family and T.target_name='$target'"; } my($db_query,$common_tar,$exp_ver_sno,$exp_ver_tar,$total); $db_query = "SELECT ST.sno_name,T.target_name,T.location,T.base_pa +ir,SM.annotated_seq FROM sno_Table ST,sno_Modifications SM,Targets T +WHERE ST.sno_id=SM.sno_id and SM.mod_id=T.target_id and (ST.org_id=$o +rig_sno) and (ST.family=$family)"; $common_tar="and T.target_id in(SELECT T.target_id FROM sno_Table +ST,sno_Modifications SM,Targets T WHERE ST.sno_id=SM.sno_id and SM.mo +d_id=T.target_id group by T.target_id having count(*)=2) order by T.l +ocation desc"; $exp_ver_sno="and ST.exper_ver='Y'"; $exp_ver_tar = "and T.exp_ver='Y'"; if ($query_type eq "snoRNAs with common targets") { $db_query=$db_query.$common_tar; } elsif ($query_type eq "Experimentally verified snoRNAs") { $db_query=$db_query.$exp_ver_sno; } elsif ($query_type eq "snoRNAs with experimentally verified target +s") { $db_query=$db_query.$exp_ver_tar; } elsif ($query_type eq "ALL"){ $db_query=$db_query; } my $sth = $dbh->prepare($db_query); $sth->execute(); my$total = $sth->rows; print "<table border=1>\n <tr> <th>snoRNA</th>\n <th>Target Name</th>\n <th>Target Location</th>\n <th>Target Base Pair</th>\n <th>Annotated Sequence</th>\n </tr>\n"; while (my@row = $sth->fetchrow_array()){ my$sno_name = $row[0]; my$tar_name = $row[1]; my$tar_loc = $row[2]; my$tar_bp = $row[3]; my$annotated_seq = $row[4]; print "<tr>\n<td>$sno_name</td><td>$tar_name</td><td>$tar_loc< +/td><td>$tar_bp</td><td>$annotated_seq</td></tr>\n"; } print "<tr> <th>TOTAL</th>\n <th>$total</th>\n </tr>\n"; print "</table>"; }

In reply to CGI and CSS by AdrianJ217

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.