Maxipoint Rep Office <[EMAIL PROTECTED]> wrote: : I am successful insert data in MySQL with code below:
I am having trouble understanding your message. I assume English is not your first language. : #!/usr/bin/perl -w : use strict; Great start! : use DBI(); : use CGI; : use HTML::Template; : : # Connect to the database. : my $dbh = : DBI->connect("DBI:mysql:database=MYDABASE;host=localhost", : "MYDBUSERNAME", "MYPASS", : {'RaiseError' => 1}); : : my $turistobjekt = "dadas"; : my $adresa = "sdasdasdfADRESA"; : my $brojgrada = "1"; : my $grad = "1"; : my $manjemjesto = "1"; : my $otok = "1"; : my $regija = "1"; : my $ime = "1"; : my $prezime = "1"; : my $tel = "1"; : my $mob = "1"; : my $fax = "1"; : my $email = "1"; : my $username = "1"; : my $password = "1"; : my $status = "1"; Are all these variables supposed to be coming from an HTML form? Is that what you want to use CGI.pm for? : $dbh->do("INSERT INTO portal (turistobjekt, adresa, brojgrada, : grad, manjemjesto, otok, regija, ime, prezime, tel, mob, fax, : email, username, : password, status) VALUES ('$turistobjekt', '$adresa', : '$brojgrada', '$grad', '$manjemjesto', '$otok', '$regija', : '$ime', '$prezime', '$tel', '$mob', '$fax', '$email', : '$username', '$password', '$status')" or die $dbh->errstr); : : $dbh->disconnect(); : : -------------------- : : : MY QUESTION: How on much simpler way with CGI.pm and : HTML::template, instead variables my $turistobjekt, my : $adresa, my $brojgrada etc. RECEIVE any data from html form : successful? HTML::Template is used to generate HTML pages. You are not doing that here. What task are you trying to accomplish, (besides the DB insert)? HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>