hello Monks! I have had this problem for days! I got sql and perl to talk and print an html table, which displays lovely in its own little site, however I cant seem to get it to display on a webpage with css and other bits of html....how can i do this? I managed to 'print' the html out and get it to display, but .css file failed, the code is as below:
#!\strawberry\perl\bin\perl.exe use DBI; print "Content-type: text/html\n\n"; print "<html>\n" ; print "<head>" ; print "<title>$ENV{'SERVER_NAME'}: perl on the browser test</title>\n" + ; print "</head>" ; print "\n" ; print "<body bgcolor=\"#FFFFFF\" text=\"#000000\" link=\"#000000\" vli +nk=\"#000000\" alink=\"#000000\">\n" ; print "\n" ; print "<p>This shows that perl is displaying on the website!</p>" ; print "<p>test</p>"; $proof = '<p>proof of the pudding</p>'; print "$proof"; $dbh = DBI->connect('dbi:mysql:aKDatabase','root','password') or die "Connection Error: $DBI::errstr\n"; $sql = "select cost, membertype from membershiptbl"; $sth = $dbh->prepare($sql); $sth->execute or die "SQL Error: $DBI::errstr\n"; print "<p>beginning database search \n</p>"; while (@row = $sth->fetchrow_array) { print "<p>@row</p>"; } print "above is your results \n"; THE ABOVE WORKS and displays a lovely table, which only took me a few +days to get working :-D <head><link rel="stylesheet" type="text/css" href="aberKarateHomeCSS.css" /> </head> <div id="logopositioning"><a href="aberKarateHome.html"><IMG BORDER="0 +" img src="karatelogo.jpg" alt="The Aberystwyth University Shotokan K +arate Club Logo"</a> </div> <div id= "header"> <div id="headertext" <h1> Aberystwyth Karate Club < +/h1></div> </div> <div id="sidebarlink"> <a href="aberKarateHome.html">Home</a> <a href= +"aberKarateLogin.html">/login</a></div> <div id="sidebar"> <div id="sidebartitle"><h3>Navigation</h3> </div> <div id="sidebarborder"> <li> <a href="aberKarateHome.html">Homepage</a> </li> <li> <a href="aberKarateAboutUs.html">About us</a> </li> <li> <a href="aberKarateFindUs.html">Find us</a> </li> <li> <a href="aberKarateCosts.html">Costs</a> </li> <li> <a href="aberKarateEvents.html">Events</a> </li> <li> <a href="aberKarateProfiles.html">Profiles</a> </li> <li> <a href="aberKarateSocials.html">Socials</a> </li> <li> <a href="aberKarateForum.html">Forum</a> </li> <li> <a href="aberKarateContactUs.html">Contact us!</a> </li> </div> </div> <div id= "maintext"> <h1> Costs</h1> THE PLAN IS THAT A TABLE OF COSTS (WITH THE DATA COMING FROM THE SQL B +ACKEND GOES HERE! <h2> Further Notes </h2> <p> Unfortently at the moment students from the Penweddig Class are un +able to train at the University sessions. This is due to the age limi +ts involved with the university and is currently out of our hands. </ +p> <p> We often have special offers avaliable to new comers at the beginn +ing and end of the year! Feel free to <a href="aberKarateContactUs.ht +ml">contact us</a> for more information! </p> </div>
----------------------------------------------------------- END OF CODE ----------------------------------------------------------- so yeah thats my question, how can i display this output, that is the results of the script on the website, rather then having it in its own useless little world? I hope this is clear, I want to merge the two! bogglemaster89.

In reply to perl to display on a website by bogglemaster89

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.