LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-19-2010, 10:38 AM   #1
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Rep: Reputation: 32
Perl/CGI


Hi folks,
I want to design a web page as in the attachment webpage.png where I have some welcome text,a marquee text, table displaying the mysql database contents,table containing text boxes(its third row of the table mentioned in the .png file) to edit text and finally three buttons edit, delete and logout.
I tried some script for that:
Code:
.....
sub delete()
{
$sth=$dbh->prepare("delete * from Employee where Last_Name=? and Age=?")||die "unable to prepare\n";
$sth->execute($name,$age)||die  "unable to execute\n";
print "Deleted Successfully "+$sth->rows()+" !";
$sth->finish();
}
.....
sub edit()
{
$sth=$dbh->prepare("update Employee set First_Name=?,Last_Name=?,Age=?,Designation=?,Salary=? where Last_Name=? and Age=?")||die "unable to prepare\n";
#$sth->execute(document.values.txtfirst.value,document.values.txtlast.value,document.values.txtage.value,document.values.txtdesg.value,document.values.txtsal.value,$name,$age)|die  "unable to execute\n";
print "Updated Successfully "+$sth->rows()+" !";
$sth->finish();
}
.....
<input type='button' name='delete' value='delete' onClick='delete()'/>
.....
<input type='button' name='edit' value='edit' onClick='edit()'\>
.....
But I'm unable to achieve the functionality.

Also the table containing only text boxes(mentioned above) should be visible only when I click on the edit button.

And I was unable to make an image as a page background. Actually where to keep that image and how to call it using <body background='the path'>)

How can I achieve this using perl CGI?
Please assist me.
Thanks in advance....
Attached Thumbnails
Click image for larger version

Name:	webpage.png
Views:	19
Size:	21.2 KB
ID:	3086  

Last edited by ashok.g; 03-19-2010 at 10:42 AM.
 
Old 03-20-2010, 09:35 AM   #2
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32
I did it myself
 
Old 03-20-2010, 09:37 AM   #3
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by ashok.g View Post
I did it myself
Good start !
 
Old 03-20-2010, 10:12 AM   #4
carltm
Member
 
Registered: Jan 2007
Location: Canton, MI
Distribution: CentOS, SuSE, Red Hat, Debian, etc.
Posts: 703

Rep: Reputation: 99
Cool. Would you mind sharing what you did? I am interested in
seeing how you accomplished this.
 
Old 03-26-2010, 04:55 AM   #5
ashok.g
Member
 
Registered: Dec 2009
Location: Hyderabad,India
Distribution: RHEl AS 4
Posts: 215

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by carltm View Post
Cool. Would you mind sharing what you did? I am interested in
seeing how you accomplished this.
Hi carltm,
One important thing in CGI/Perl is that you cannot execute dynamic perl scripts by normal java scripting. You need to have Asynchronous JavaScript And XML(AJAX).
Or you can redirect to some other cgi script or Perl script on clicking a button.

HTH
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with perl modules declaration and perl/cgi script shifter Programming 9 02-24-2010 09:09 AM
Perl CGI:Can't locate CGI.pm supermyself Programming 13 09-10-2007 06:22 AM
perl cgi neil Programming 3 07-07-2004 04:52 AM
cgi perl : I cant get perl to append my html file... the_y_man Programming 3 03-22-2004 05:07 AM
cgi+perl barbanero General 0 04-07-2002 12:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration