P
PHP2
I am successful insert data in MySQL with code below:
#!/usr/bin/perl -w
use strict;
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";
$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?
I am read documentation, but whole day have errors.. can someone add and
explain own code connected with my above insert data script..
#!/usr/bin/perl -w
use strict;
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";
$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?
I am read documentation, but whole day have errors.. can someone add and
explain own code connected with my above insert data script..