473,320 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Problem linking html and cgi together

170 100+
hey guys, this is something on html and cgi taken from some example on the net
but i got problem getting it work
the html code is:

Expand|Select|Wrap|Line Numbers
  1.  <HTML>
  2.         <HEAD>
  3.           <TITLE>HTML Form Example</TITLE>
  4.         </HEAD>
  5.         <BODY>
  6.           <FORM method="GET" action="c:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/lesson2.pl">
  7.             <h3>Your First Name:</h3>
  8.             <p><INPUT type="text" name="FirstName"></p>
  9.             <h3>Your Last Name:</h3>
  10.             <p><INPUT type="text" name="LastName"></p>
  11.             <h3>Check if you are a student:</h3>
  12.             <p><INPUT type="checkbox" name="isStudent"></p>
  13.             <h3>What is your gender?</h3>
  14.             <p>
  15.               <INPUT type="radio" name="Gender" value="isMale">Male
  16.               <INPUT type="radio" name="Gender" value="isFemale">Female
  17.             </p>
  18.             <h3>How many moons are there on your planet?</h3>
  19.             <p>
  20.             <SELECT name="numMoons" size="5">
  21.               <OPTION value="1" selected>Only One Moon
  22.               <OPTION value="2">Two Nice Moons
  23.               <OPTION value="3">A Fine Triplet
  24.               <OPTION value="4">Four Celestial Bodies
  25.               <OPTION value="5-8">Between Five and Eight
  26.               <OPTION value="9-12">We Have Between Nine and Twelve
  27.               <OPTION value="lots">Too Many To Count!
  28.             </SELECT>
  29.             </p>
  30.             <h3>Comments:</h3>
  31.             <p><TEXTAREA rows="10" cols="80">Type Comments Here</TEXTAREA></p>
  32.             <h3>Hidden Data!</h3>
  33.             <p><INPUT type="hidden" name="Secret" value="Invisible"></p>
  34.             <h3>Submit this Form</h3>
  35.             <p><INPUT type="submit" value="Send Data Now!"></p>
  36.             <h3>Reset this Form</h3>
  37.             <p><INPUT type="reset" value="Clear all my input now"></p>
  38.         </FORM>
  39.       </BODY>
  40.     </HTML>
  41.  
and the cgi script is
Expand|Select|Wrap|Line Numbers
  1. #!/perl/bin/perl
  2.  
  3. use strict;
  4. use CGI;
  5. my $cgi = new CGI;
  6. print
  7.     $cgi->header(),
  8.     $cgi->start_html( -title=>'Form Results',
  9.               -author=>'Craig Kelly'),
  10.     $cgi->h1('Form Results'), "\n";
  11. my @params=$cgi->param();
  12. print '<TABLE border="1" cellspacing="0" cellpadding="0">', "\n";
  13. foreach my $parameter (sort @params){
  14.     print "<tr><th>$parameter</th><td>", $cgi->param($parameter), "</td></tr>\n";
  15.     }
  16.     print "</TABLE>\n";
  17.     print $cgi->end_html;
  18.     exit(0);
  19.  
the html form is supposed to feed all the parameters into my cgi script
but each time i click on my submit button,
instead of bringing me to the page with my tables and results
it's giving me a prompt of weather i wanna open the lesson2.pl script
any idea why?
May 23 '08 #1
2 1713
KevinADC
4,059 Expert 2GB
this can't be correct:

Expand|Select|Wrap|Line Numbers
  1. action="c:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/lesson2.pl"
the action attribute points to a URL, not the directory where the script is. Generally you use "localhost" for a local install of apache:

Expand|Select|Wrap|Line Numbers
  1. action="localhost/cgi-bin/lesson2.pl"
May 23 '08 #2
poolboi
170 100+
this can't be correct:

Expand|Select|Wrap|Line Numbers
  1. action="c:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/lesson2.pl"
the action attribute points to a URL, not the directory where the script is. Generally you use "localhost" for a local install of apache:

Expand|Select|Wrap|Line Numbers
  1. action="localhost/cgi-bin/lesson2.pl"
yepz...got it
alright thanks for the advice on the directory change
May 26 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Rob Ratcliff | last post by:
I'm compiling the latest version of a CORBA ORB called MICO on a Cray X1. It makes heavy use of templates and namespaces. Up until the link step, the C++ source code compiled flawlessly. But, when...
7
by: Steven T. Hatton | last post by:
Is there anything that gives a good description of how source code is converted into a translation unit, then object code, and then linked. I'm particularly interested in understanding why putting...
3
by: Stephen Gray | last post by:
Hi, What I'm trying to do is produce a number of XML documents that can be linked together. For example say I had one document called "valuations.xml" which is a lists all of the...
1
by: Peetah_junkmail | last post by:
Hi, I'm not sure this is completely a C related question since it's more about linking problems, so don't hesitate to redirect me to a more appropriate NG. I have a set of useful functions...
2
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c...
0
by: The Frog | last post by:
Hello Everyone, I have been asked to try and create a single SQL query to retrieve product information from a database. The way that data is arranged is that in some tables there are user...
2
by: NvrBst | last post by:
I have C99 code (which I changed extensions to .cpp to compile as C+ +98). Which is does fine. I create a Static Library Project (.lib) and Build, and it builds the .obj files (9 of them) and...
2
by: Jim Johnson | last post by:
C++ linking works by using Linker to combine object files into single exe file. Does each .cpp file compile to a single .obj file? If the .cpp code called functions in some library (.lib) does...
4
by: naveenmurthy | last post by:
Hello All, I have created a .mht file in following format. 1. The .mht file contains following htmls. a. MHTLinkingProblem.html b. Left.html c. Right.html d. Start.html
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.