Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

sandeepbharmoria's scratchpad

by sandeepbharmoria (Beadle)
on Jun 28, 2008 at 13:20 UTC ( #694513=scratchpad: print w/replies, xml ) Need Help??

<--html Template started--> <html> <head> <title><TMPL_VAR name=TITLE></title> </head> <body> <table align="center" border="1" bordercolor="#009999" cellspacing="0" +> <form name="index"> <TMPL_LOOP NAME=ROWS1> <tr > <td><input type="text" value="<TMPL_VAR NAME=Login>"/></td> </tr> <tr> <td><input type="text" name="JDate" value="<TMPL_VAR NAME=JoinDate>"/> +</td> </tr> <tr> <td><select name="Mentor_dept_list"> <option value="selected">-- SELECT --</option> <!-- This loop is not working--> <TMPL_LOOP NAME=ROWSk> <OPTION><TMPL_VAR NAME=DepartmentName></OPTION> </TMPL_LOOP> <!-- This loop is not working--> </select></td> </tr> </TMPL_LOOP> <tr> <td colspan="2" align="center"><input type="submit" /><input type="res +et"/></td> </tr> </form> </table> </body> </html> <--html template finish--> <--perl code--> #!/grid/common/pkgs/perl/v5.8.0/bin/perl -w use CGI; use DBI qw(:sql_types); use HTML::Template; my $cgi = CGI->new; #my @tmpl_opts = (cache => 1, die_on_bad_params => 0, associate => $cg +i); my $template = HTML::Template->new(filename => 'addmodify.tpl'); my $dbh = DBI->connect('dbi:mysql:mentorship', 'pmweb', ''); ################################################################# ########## FETCHING THE DEPARTMENT NAMES ################################################################# my $sth = $dbh->prepare('select distinct departmentName from tbl_depar +tment_names'); my($departmentName); $sth->execute; $sth->bind_columns(\($departmentName)); my @rows; while($sth->fetch) { push @rows, {DepartmentName => $departmentName}; } ###################################################### ########## DEPARTMENT NAMES FETCHING ENDED ## ###################################################### my $sth1 = $dbh->prepare('select mentee_login , date_of_join from tbl_ +mentee_details where mentee_login="urmil"'); my ($login,$joindate); $sth1->execute; $sth1->bind_columns(\($login,$joindate)); my @rows1; while($sth1->fetch) { push @rows1, {Login => $login,JoinDate => $joindate,ROWSk=>\@row +s }; } ###################################################### ####Selecting the Status of mentee for the Template ###################################################### $template->param({ TITLE=>'Mentorship System', ROWSk=>\@rows, ROWS1=>\ +@rows1}); print "Content-Type: text/html\n\n", $template->output; <!--perl code-->
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2019-04-26 07:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I am most likely to install a new module from CPAN if:
















    Results (128 votes). Check out past polls.

    Notices?
    • (Sep 10, 2018 at 22:53 UTC) Welcome new users!