sprakash has asked for the wisdom of the Perl Monks concerning the following question:
#!/perl/bin require 'cgi-lib2.pl'; use CGI qw(:standard); # Must be used to get the param() functi +on use strict; use OLE; my $formemail = param("formemail"); my $formpass = param("formpassword"); my $formcpass = param("cformpassword"); my $formfriend = param("formfriendOf"); # This section is for appending the data to the database. sub new_record { my $dbh; $dbh = CreateObject OLE "ADODB.Connection" or die "Can't create connec +tion to DataBase: $!" unless $dbh; $dbh->Open("Driver={Microsoft Access Driver (*.mdb)};DBQ=_private/db1. +mdb"); my $rs = CreateObject OLE "ADODB.Recordset" or die "can not create rec +ordset"; my $sql; $sql = "INSERT INTO $formfriend (email,password) VALUES ($formemail,$f +ormpass)"; $rs = $dbh->Execute( $sql ) or die print ( "Can't execute SQL statemen +t. Perl says $!, DBI says ",$dbh::errstr,"\n"); } print &PrintHeader; print &HtmlTop ("Success!"); new_record(); print "Email: $formemail<br>\n"; print "Password: $formemail<br>\n"; print "Friend Of: $formfriend<br>\n"; print &HtmlBot;
|
|---|