create connection from html form into insert MySQL data script

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..
 
G

Gunnar Hjalmarsson

PHP2 said:
I am successful insert data in MySQL with code below:

You are multi-posting again!!!

(This question is already being answered at the (e-mail address removed) list.)

Last time I noticed that rude behaviour from you:
http://groups.google.com/[email protected]

Do you really think that your time is so much more worth compared to
everybody else's?

BUUHHHH!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top