in reply to Interesting CSS/CGI issue...

the question is, how am I supposed to get it to set the value of stylesheet.cgi's $content to the stylesheet?

I don't understand this question. Context might help. Perhaps you should post some code.

I've tried having stylesheet.cgi print out the stylesheet information at the end, but to no avail.

Well, that's exactly what you should do. You should also print the correct content-type header. Start simple and work your way up. This might get you started:

#!/usr/bin/perl use warnings; use strict; print "Content-type: text/css\n\n"; print <<END_CSS; body { color: red; } END_CSS
-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re^2: Interesting CSS/CGI issue...
by Spidy (Chaplain) on Sep 24, 2005 at 06:40 UTC
    Well, here's stylesheet.cgi:
    #!/usr/bin/perl -w # # #error reporting modules use strict; #CGI modules use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser warningsToBrowser); #database modules use DBI; my $query = new CGI; my $id = $query->param('skin'); my $content = ''; my $sth = ''; my $dbh = DBI->connect("DBI:mysql:****","****","****") or die("Error connecting to MySQL Database: $DBI::errstr\n"); $content = $dbh->selectrow_array("SELECT content FROM skins WHERE id = + $id"); print "Content-type: text/css\n\n"; print qq ~ $content ~;

    Which still doesn't work. It's printing out $content all right, and that's all working...but when I try to use that line of HTML, nothing happens.
    (the content for the first skin is just .body{background-color: #00FF00;})

      Is your server properly configured to run CGI scripts? You might try temporarily changing your content type to text/plain and hitting the script from your browser.

      -sauoq
      "My two cents aren't worth a dime.";
      
        Turned out that it was the period before "body".