bogglemaster89 has asked for the wisdom of the Perl Monks concerning the following question:
----------------------------------------------------------- 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.#!\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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl to display on a website
by hangon (Deacon) on Mar 04, 2010 at 01:19 UTC | |
|
Re: perl to display on a website
by Skriptke (Acolyte) on Mar 04, 2010 at 08:42 UTC | |
by Anonymous Monk on Mar 04, 2010 at 08:47 UTC | |
by Skriptke (Acolyte) on Mar 04, 2010 at 08:56 UTC |