Gossamer Forum
Home : General : Perl Programming :

urgent help needed !!!

Quote Reply
urgent help needed !!!
I have html form which I just print using print in cgi.

The code looks like this.I wanna know how to extract the options which I select in the form.Its a little urgent.please send ur response asap.

#!/usr/bin/perl -wT
use strict;
print <<END;
content-type: text/html
<title>Wind Forecast Search</title></head>
<body bgcolor="#A4C1A4">
<table width="738" border="0" align="center" cellpadding="0" cellspacing="0">
<td width="738" height="852" bgcolor="#FFFFFF">
<p align="center"><font color="#000000" size="5"><strong> <font size="6">Atmostpheric
Predictions for the Gulf of Mexico</font></strong></font></p>
<p align="center"><font color="#000000" size="2" face="Arial">A </font><font size="2" face="Arial">Joint
project of DNR &amp; Corpus Christi Weather Forecast Office </font></p>
<div align="center"><img src="http://lighthouse.tamucc.edu/~karthik/page map.jpg" width="738" height="469" border="1">
<div align="center"></div>
<FORM name="app" action="1.cgi" method="post">
<table width="565" border="0" align="center" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
<td width="561" height="40" bordercolor="#669966" bgcolor="#669966">
<div align="center"><B><font color="#FFFFFF" size="6" face="Arial">Search </font></B></div></td>
<td height="75" bgcolor="#FFFFFF"> <div align="center">
<blockquote> <font color="#000000" size="5"><font face="Arial">Year
of Forecast </font></font>
<table width="333" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000">
<tr bgcolor="#FFFFFF">
<td width="329" height="29"> <P> <font face="Arial">
&nbsp<strong> <font size="2">
<INPUT type="radio" name="year" value="2002">
</font></strong> <font color="#336699" size="2"> <font color="#000000">2002
<INPUT type="radio" name="year" value="2003">
<INPUT type="radio" name="year" value="2004">
2004</font></font></font> <font color="#000000" size="2" face="Arial">
<INPUT type="radio" name="year" value="All">
All the available Data</font> </td>
<td height="64" bgcolor="#669966"> <div align="center">
<LABEL><font color="#FFFFFF" size="5"><font face="Arial">Station
<font face="Arial">
<select NAME="stationname">
<option value="Amarillo">Amarillo</option>
<option value="Aransas Bay">Aransas Bay</option>
<option value="Arroyo Colorado">Arroyo Colorado</option>
<option value="Yukatan Channel">Yukatan Channel</option>
<input type="checkbox" name="val" value="lat_long">
<font color="#FFFFFF"><strong>Latitude &amp; Longitude </strong></font></font></div></td>
<td height="51" bgcolor="#FFFFFF"> <div align="center"> <font color="#000000" size="2" face="Arial">
<input type="checkbox" name="val" value="U_V">
U &amp; V (m/s)
<input type="checkbox" name="val" value="BP">
Barometric Pressure
<input type="checkbox" name="val" value="TEMP">
Temperature </font></div></td>
<td height="42" bgcolor="#669966"> <div align="center">
<input type="submit" name="Request" value="Search our database">
<input type="reset" name="Clear" value="Clear Form and Start Over">
print "</body></html>";
Quote Reply
Re: [karthik] urgent help needed !!! In reply to

Add these lines into that file, perhaps before the print << EOF;

use CGI;
my $cgi = new CGI;
my $val = $cgi->param('val');

Then insert the $val variable into suitable place in your html page




Programming and creating plugins and templates