MySQL Forums
Forum List  »  Perl

error in perl program.
Posted by: arupratan biswas
Date: May 07, 2005 12:39AM

sorry i have corrected some error after that my code is as below

#!/usr/bin/perl -w

use CGI;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
use DBI;

my $ query= new CGI;
print $query->header();
warningsToBrowser(1);
print $query->start_html(-title=> 'Update Profile');

$toname=$ENV{QUERY_STRING};
$toname= ~ tr/+/ /;
$toname=~ s /%(..)/chr hex $1/eg;

print $"toname";

if(($query->request_method eq 'POST') &&($query->param("emp_name") ne '') && ($query->param("emp_code") ne '') && ($query->param("dob") ne '') && ($query->param("gender") ne ''))
{
$ename=$query->param("emp_name");
$ecode=$query->param("emp_code");
$d=$query->param("dob");
$g=$query->param("gender");

$dbh=DBI->connect("DBI:mysql:administrative:192.168.0.142:""root",undef) or die "Don't connect to Database:DBI::errstr\n";
$sth=$dbh->prepare("Update new_user SET emp_name='$ename',emp_code='$ecode',dob='$d',gender='$g' where emp_name=?");
$sth->execute($toname);

}
else
{

print"<HTML>";
print"<BODY>";
print"<FORM METHOD='POST' ACTION='u_profile.pl'>";
print"<p>Employee Name: </p>";
print"<p> input type='text' name='emp_name' value= '$ename'</p>$name<br>";
print"<p>Employee Code: </p><br>";
print"<p> input type='text' name='emp_code' value='$ecode'</p>$ecode<br>";
print"<p>Date Of Birth: </p>";
print"<p> input type=''text' name='dob' value='$d'</p>$d<br>";
print"<p>gender Of Employee: </p>";
print"<p> input type ='text' name='gender' value='$g'</p>$g<br>";
print"<p> input type ='submit' value='update'</p>";
print"</FORM>";
print"</BODY>";
print"</HTML>";
print $query->end_html();
}


there have many error line 22 23 25 26 31 33 .....
plzz help me

Options: ReplyQuote


Subject
Written By
Posted
error in perl program.
May 07, 2005 12:39AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.