
dpuk44
Novice
Jul 30, 2011, 5:18 AM
Post #1 of 4
(805 views)
|
|
Perl script in HTML file
|
Can't Post
|
|
Hi folks, i'm fairly new to Perl. I am trying to understand how to display my Perl script in a html page. 1). I have a MySQL database called perltest. 2). I have my Perl script that links to the database called test.pl. #!C:/Perl/bin use DBI; $dbh = DBI->connect('dbi:mysql:perltest','root','root') or die "Connection Error: $DBI::errstr\n"; $sql = "select * from samples"; $sth = $dbh->prepare($sql); $sth->execute or die "SQL Error: $DBI::errstr\n"; while (@row = $sth->fetchrow_array) { print "@row\n"; } Now I want to display this into a webpage (html file), but im dont know where to begin. Any help would be much apprciated. Can I do this locally on my machine?
|