Re: REG: dbi::errstr error.



On 1/27/06, Dilly raja <rajadilly@xxxxxxxxx> wrote:
>
> I have a cgi script adduser.cgi which collects the data from the user
> through adduser.html. when i execute this script i encountered the error
> as
> shown below.
>
> Name "dbi::errstr" used only once: possible typo at adduser.cgi line 18.



The message is precise - and Perl is case-sensitive.


the complete script of the adduser.cgi is shown below. Since i am new to
> perl and mysql i cant able to find out the reason for the error. i will
> thankful if you find out the reason for this.
>
>
> the cgi script is
>
> #!c:/perl/bin/perl -w
>
> use CGI;
> use DBI;
> my $cgi=new CGI;
>
> $name = $cgi->param("name");
> $email=$cgi->param("email");
> $phone=$cgi->param("phone");
> $address=$cgi->param("address");
> $username=$cgi->param("username");
> $password=$cgi->param("password");
>
> my $dbh=DBI->connect ("DBI:mysql:dvd","","autoraja")||
> die "Error opening database: $DBI::errstr\n";
> $sth=$dbh->prepare("insert into user(name, email, phone, address,
> username,
> password)
> values($name, $email, $phone, $address, $username,
> $password)");
> $sth->execute()||die "Unable to insert the value: $dbi::errstr\n";
> $dbh=disconnect();
>
> print "Content-type: text/html\n\n";
> print "<HTML>";
> print "<HEAD><TITLE>CGI Process: $name\n</TITLE></HEAD>";
> print "<BODY>";
>
> if($name eq "")
> {
> print "<H1>Invalid Name. Please Try Again.</H1></BODY></HTML>";
> exit (0);
> }
>
> print "The name is <b>", $name, "</b>";
> print "</BODY></HTML>";
>
>
>
> --
> Friendly,
> Raja.M
>
>


--
Jonathan Leffler <jonathan.leffler@xxxxxxxxx> #include <disclaimer.h>
Guardian of DBD::Informix - v2005.02 - http://dbi.perl.org
"I don't suffer from insanity - I enjoy every minute of it."


Relevant Pages

  • Humble questions for web developers in freebsd.
    ... perl cgi scripts as well. ... trouble installing it, but when I wrote my first ... "Hello World" cgi script, I end up with an internal ... the ownership of the entire apache directory for me to ...
    (freebsd-questions)
  • Re: Perl CGI Issue
    ... I'm having an issue with a perl CGI script. ... In my head, this code should print the output message to stdout, start ... It could be that you are flushing the buffer to the web-server, ...
    (comp.lang.perl.misc)
  • "su -" in CGI script ?
    ... I'm trying to execute a specific command from a CGI script written in PERL. ... I have to be a special user so I've tried to use "su -" but it doesn't work. ...
    (comp.lang.perl.misc)
  • Re: Newbie question - calling perl from html
    ... >feature of most every web browser these days; Perl is not. ... Your Perl script is a CGI script ... by explaining I'd looked at perl scripts for counters, ...
    (comp.lang.perl.misc)
  • Re: perl cgi script buffering?
    ... I have a html doc that calls a perl cgi script to list or write a scsi ... If I submit from the html document on the local machine it displays the ... Randal Schwartz, Linux Magazine, Aug 2002: ...
    (comp.lang.perl.misc)