Is it possible to use Tk coding in cgi?
While running Tk alone, its working properly, but when i am using in cgi, I am not getting the output.
#!C:\perl\bin\perl use strict; use CGI; use DBI; use Tk; use Tk::HList; my $q = new CGI; print $q->header("text/html"), $q->start_html(-title=>"test"); print $q->p("hi"); my $dbh = DBI->connect("DBI:mysql:velusamy", {PrintError =>0, RaiseErr +or =>0}) ; #automatic error checking my $data = qq(select empno, name from testing order by name); my $sth = $dbh->prepare($data); $sth->execute; my ($sno, $name); my $mw = MainWindow->new; my $hlist = $mw->HList(-columns => 2, -header => 1) ->pack(-expand => 1, -fill => 'both'); $hlist->headerCreate(0, -text => "Emp-No"); $hlist->headerCreate(1, -text => "Emp-Name"); while ( ( $sno, $name) = $sth->fetchrow_array ) { $hlist->add($sno); $hlist->itemCreate($sno, 0, -text => uc($sno)); $hlist->itemCreate($sno, 1, -text => uc($name)); } MainLoop; $dbh->disconnect; print $q->end_html;
Give your suggestions.
Regards,
Samy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |