anilhpn has asked for the wisdom of the Perl Monks concerning the following question:
I have written html code which has to operate based on a perl cgi file. I stored that in /var/www/cgi-bin/ folder. I have given the same path in the html page. That CGI script needs to connect to a MySQL server. I have written every thing. But whenever I click on any button it is taking me the perl CGI script. Not operating accordingly.
I am new to this CGI scripting. So, kindly guide me.
HTML Code:Cgi Code (currently I am not doing any operation as I felt the integration between html page and the cgi script is not proper):<hr> <form name="node" action="/home/anil/Desktop/displayPort.cgi" method=" +POST"> <input type="radio" name="choice" value="add"> Add <input type="radio" name="choice" value="del"> Delete <input type="radio" name="choice" value="display"> Display <input type="radio" name="choice" value="update"> Update <input type="submit" value="ClickMe"> </form>
My main requirement is when I click on any button mentioned in above should lead me to that operation. So suggest me what kind of code I need to add in the cgi script and how do I integrate it with a sql server. Thanks! Anil A Kumar#!/usr/bin/perl use DBI; use CGI; print "Content-type:text/html\r\n\r\n"; print "<title>Updation\\Display</title>"; print "<body bgcolor=\"#98AFC7\">"; $query = new CGI; print "Content-type: text/html\n\n"; print <<EOF; <HTML> <HEAD> <TITLE>Hello, world!</TITLE> </HEAD> <BODY> <H1>Hello, world!</H1> </BODY> </H
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl CGI and DB Integration
by zentara (Cardinal) on Sep 16, 2011 at 10:36 UTC | |
|
Re: Perl CGI and DB Integration
by keszler (Priest) on Sep 16, 2011 at 11:03 UTC | |
|
Re: Perl CGI and DB Integration
by zentara (Cardinal) on Sep 16, 2011 at 16:58 UTC | |
|
Re: Perl CGI and DB Integration
by jethro (Monsignor) on Sep 16, 2011 at 10:38 UTC |