MySQL Forums
Forum List  »  Perl

fetch a problem in perl programming.
Posted by: arupratan biswas
Date: May 17, 2005 04:48AM

whaen i want to update my current profile then it show the current value in every field except photo,thats why whan i want to update my profile suppose changing only my name then the browse field remain blank for that after updation i couldnot see my picture that field would be blank.
thats my code:
#!/usr/bin/perl

use CGI;
use DBI;
$q=new CGI;
$y=$q->param('PRO');
$z=$q->param('abc');

if ($y eq 'update profile')

{

$d= new CGI;
$id=$d->param('emp_id');
#$pass=$d->param('password');

$dbh = DBI->connect("dbi:mysql:test:192.168.0.95","bobby","bobby");
$sqlstatement="select emp_name ,emp_add,City,Zipcode,Dob,phone,photo from Employee where emp_id ='$z'";
$sth = $dbh->prepare($sqlstatement);
$sth->execute ||
die "Could not execute SQL statement ... maybe invalid?";
while(@host=$sth->fetchrow_array)
{

print "Content-type: text/html\n\n";
print "<html>";
print "<head>";
print "<title>update database form</title>";
print "</head>";
print "<body>";
print "<h1> PROFILE <h1>";
print "<form method='post' action='code_up.pl' enctype='multipart/form-data'>";
print "<input type='hidden' name='uv' value='$z'>";
print "<h5> name<h5>";
print "<input type='text' name='emp_name' value='@host[0]'><br>";
print "<h5> address<h5>";
print "<input type='text' name='emp_add' value='@host[1]'><br>";
print "<h5> city<h5>";
print "<input type='text' name='City' value='@host[2]'><br>";
print "<h5> Zipcode<h5>";
print "<input type='text' name='Zipcode' value='@host[3]'><br>";
print "<h5> Date of birth <h5>";
print "<input type='text' name='Dob' value='@host[4]'><br>";
print "<h5> phone<h5>";
print "<input type='text' name='phone' value='@host[5]'><br>";
print "<h5> photo<h5>";
print "<input type='file' name='photo value='@host[6]'>";
#print "<input type='text' name='photo' value='@host[6]'>";
print "<input type='submit' value='send'>";
print "<input type='reset' value='reset'>";
print "</form>";
print "</body>";
print "</html>";
}
}

plz help me out from that critical situation.

Options: ReplyQuote


Subject
Written By
Posted
fetch a problem in perl programming.
May 17, 2005 04:48AM


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.