Hi Monks,

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:
<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>
Cgi Code (currently I am not doing any operation as I felt the integration between html page and the cgi script is not proper):
#!/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
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

In reply to Perl CGI and DB Integration by anilhpn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.