473,480 Members | 1,901 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CGI Script - Not getting form value

30 New Member
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title></title>
  4. <body>
  5. <form name=name form method=post action=C:/inetpub/wwwroot/b.cgi>
  6. enter your name:<input name=name type=text><br>
  7. <input type=submit>
  8. </form>
  9. </body>
  10. </html>
  11.  
below is the b.cgi file
Expand|Select|Wrap|Line Numbers
  1. #!/perl/bin/perl5.6.1.exe
  2. use strict;
  3. use CGI qw(:standard);
  4. my $name=param("name");
  5. print "Content-Type:text/html\n\n";
  6. print $name;
  7.  
I am using IIS server......"$name" is not getting printed.
Apr 17 '07 #1
7 1543
KevinADC
4,059 Recognized Expert Specialist
Add a sanity check to make sure the CGI script is at least working:

Expand|Select|Wrap|Line Numbers
  1. #!/perl/bin/perl5.6.1.exe
  2. use strict;
  3. use CGI qw(:standard);
  4. my $name=param("name");
  5. print "Content-Type:text/html\n\n";
  6. print "Sanity check - it works\n"
  7. print $name;
.
Apr 17 '07 #2
tovenkatesh82
30 New Member
yes the cgi script is working fine.....i have done a sanity check.


Add a sanity check to make sure the CGI script is at least working:

Expand|Select|Wrap|Line Numbers
  1. #!/perl/bin/perl5.6.1.exe
  2. use strict;
  3. use CGI qw(:standard);
  4. my $name=param("name");
  5. print "Content-Type:text/html\n\n";
  6. print "Sanity check - it works\n"
  7. print $name;
.
Apr 18 '07 #3
KevinADC
4,059 Recognized Expert Specialist
maybe its the form tag:

Expand|Select|Wrap|Line Numbers
  1. <form name=name form method=post action=C:/inetpub/wwwroot/b.cgi>
remove the second "form" and retry.

the path also looks wrong:

C:/inetpub/wwwroot/b.cgi

that should be a URL not a machine path.

http://localhost/cgi-bin/b.cgi

or something like that.
Apr 18 '07 #4
tovenkatesh82
30 New Member
tried out whatever you suggested but it does not works.......can you tell me why
not to use the machine path?......since i am working on iis server i saved the
.cgi file in wwwroot dir.......the path i mentioned in the html file is http://localhost/b.cgi

maybe its the form tag:

Expand|Select|Wrap|Line Numbers
  1. <form name=name form method=post action=C:/inetpub/wwwroot/b.cgi>
remove the second "form" and retry.

the path also looks wrong:

C:/inetpub/wwwroot/b.cgi

that should be a URL not a machine path.

http://localhost/cgi-bin/b.cgi

or something like that.
Apr 18 '07 #5
KevinADC
4,059 Recognized Expert Specialist
The machine path is the direct path to the cgi/perl script. Thats not how you normally invoke cgi scripts from a browser, not even a local script on a local server. You send the request to the server (via a URL) which processes the request and sends a response back to the browser. Maybe iis works differently but I don't think so.
Apr 18 '07 #6
tovenkatesh82
30 New Member
hi kevin....do i need to install or add some module to my code before using
the param function as the perl compiler is not recognizing the param function....
i looked into CPAN but i did not got anything concrete....do u have any idea
regarding this??

The machine path is the direct path to the cgi/perl script. Thats not how you normally invoke cgi scripts from a browser, not even a local script on a local server. You send the request to the server (via a URL) which processes the request and sends a response back to the browser. Maybe iis works differently but I don't think so.
Apr 19 '07 #7
KevinADC
4,059 Recognized Expert Specialist
You might need to install the CGI.pm module. The version of perl your script appears to be using is very old:

perl5.6.1.exe

I would suggest installing the newest version of perl which I think is 5.8.8 (don't install perl 6).
Apr 19 '07 #8

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

Similar topics

6
5386
by: bojanraic | last post by:
Hi! I recently started playing with Python CGI, and I was happy that my basic input-name--print-hello-name CGI form example worked, so I thought I should advance to somew\hat more complicated...
1
7456
by: Wayne Deleersnyder | last post by:
Hi, I'm a newbie at Perl and CGI and hoping someone can point me in the right direction. Recently I've been going through an older book I have on CGI programming to get a start. Most of it...
6
3761
by: Andrew V. Romero | last post by:
First off, I am mostly familier with PHP but am trying to make a multi-step javascript program. For an example, I would like to run different sections of the script depending on how many times the...
8
2508
by: JS | last post by:
I've managed to create a simple script to convert between metric and imperial. It works for CMS to INCHES and vice versa but not for KGS to STONES/POUNDS. Can anyone shed any light on this? ...
9
2190
by: Jerim79 | last post by:
I am no PHP programmer. At my current job I made it known that I was no PHP programmer during the interview. Still they have given me a script to write with the understanding that it will take me a...
4
4053
dreamcatcher
by: dreamcatcher | last post by:
Hi everyone, I'm a frontend designer starting to learn about getting forms to work. What I'm after is a script that I can learn from and get working on a site relatively quickly. Something that...
3
1694
tolkienarda
by: tolkienarda | last post by:
hi all i have a problem i have a script that i got working exactly the way i wanted it. and then i tried to intrigate it into the site and it totaly stopped working. below is the original code ...
15
5845
by: webstormcomputers | last post by:
I'm trying to update a hidden field with java script and I'm only getting one of the values from my select stament. Here is the code below. <select name="on0"> <option value="25">25 <option...
10
2250
by: jonathan184 | last post by:
Hi I tried getting this to work through dreamweaver but it did not. So i found a n example on the internet , i followed everything exactly the search script does not work. Could somebody help me...
1
47337
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
7032
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7076
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6730
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6873
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4767
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
2976
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1294
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
558
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
174
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.