create connection from html form into insert MySQL data script

Discussion in 'Perl Misc' started by PHP2, Sep 8, 2004.

  1. PHP2

    PHP2 Guest

    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..
     
    PHP2, Sep 8, 2004
    #1
    1. Advertising

  2. PHP2 wrote:
    > I am successful insert data in MySQL with code below:


    You are multi-posting again!!!

    (This question is already being answered at the list.)

    Last time I noticed that rude behaviour from you:
    http://groups.google.com/groups?selm=

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

    BUUHHHH!

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Sep 8, 2004
    #2
    1. Advertising

  3. PHP2

    PHP2 Guest

    I still have not any advice.. only some buuuh messages




    "Gunnar Hjalmarsson" <> wrote in message
    news:...
    > PHP2 wrote:
    > > I am successful insert data in MySQL with code below:

    >
    > You are multi-posting again!!!
    >
    > (This question is already being answered at the list.)
    >
    > Last time I noticed that rude behaviour from you:
    > http://groups.google.com/groups?selm=
    >
    > Do you really think that your time is so much more worth compared to
    > everybody else's?
    >
    > BUUHHHH!
    >
    > --
    > Gunnar Hjalmarsson
    > Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    PHP2, Sep 8, 2004
    #3
  4. Gunnar Hjalmarsson, Sep 8, 2004
    #4
  5. Gunnar Hjalmarsson <> wrote in news:2q8j87Fm4k1tU1@uni-
    berlin.de:

    > PHP2 wrote:
    >> I still have not any advice.. only some buuuh messages

    >
    > Liar!
    >
    > http://www.mail-archive.com//msg61543.html
    >


    Gunnar, you're good!

    Sinan.
     
    A. Sinan Unur, Sep 8, 2004
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry Zoroc
    Replies:
    1
    Views:
    990
    Gregory Vaughan
    Jul 12, 2004
  2. impulse()
    Replies:
    0
    Views:
    2,564
    impulse()
    Oct 13, 2006
  3. brianrpsgt1
    Replies:
    0
    Views:
    1,028
    brianrpsgt1
    Nov 8, 2008
  4. Jeffrey H. Coffield
    Replies:
    1
    Views:
    1,931
  5. Aaron Smith

    insert marshall'd data into mysql

    Aaron Smith, Jun 25, 2007, in forum: Ruby
    Replies:
    4
    Views:
    171
    Aaron Smith
    Jun 25, 2007
Loading...

Share This Page