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
In reply to Perl CGI Database Connectivity by savanmk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |