savanmk has asked for the wisdom of the Perl Monks concerning the following question:
Hi all,
I have a Following code:
#! c:/perl/bin/perl.exe use CGI qw(:standard); use DBI; use CGI::Carp qw(warningsToBrowser fatalsToBrowser); $dbh = DBI->connect("DBI:mysql:database=perldbi;host=localhost","root" +,""); $sth = $dbh->prepare('select * from test'); $sth->execute(); print header; print start_html('Newgen Imaging Systems(P) Ltd.,'); print h1("Hello world"); if($sth->rows == 0) { print h1("YES"); } else { print h4("This is available table\n"); print "<table border=2>\n"; while( $resptr = $sth->fetchrow_hashref()) { print "<tr>"; print "<td>". $resptr->{"name"}; print "<td>". $resptr->{"pass"}; print "\n"; print "<\/tr>"; } print "<\/table>\n"; } print "<br><input type='text' name='usrtxt'>"; print "<br><input type='text' name='passtxt'>"; print "<br><input type='submit' name='logbtn' value ='Insert'>"; print "\t\t"; print "<input type='submit' name='logbtn' value ='Clear'>"; $dbh->disconnect; print end_html;
My doubt is:
If am click the button 'logbtn' then the values in the two text box is store into the database
Anyone please help me
20070407 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl CGI Database Connectivity
by friedo (Prior) on Apr 07, 2007 at 07:57 UTC | |
|
Re: Perl CGI Database Connectivity
by talexb (Chancellor) on Apr 07, 2007 at 16:49 UTC | |
|
Re: Perl CGI Database Connectivity
by TOD (Friar) on Apr 07, 2007 at 11:40 UTC | |
by Joost (Canon) on Apr 07, 2007 at 12:28 UTC |