473,545 Members | 2,715 Online
Bytes | Software Development & Data Engineering Community
+ 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......"$n ame" is not getting printed.
Apr 17 '07 #1
7 1551
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?......sinc e 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
5392
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 scripts. I'm trying to write a basic Python email CGI script to send email through HTML email form. I've seen a lot of examples out there, but...
1
7468
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 involves using Perl 5 though. The book is "Sams Teach Yourself CGI Programming In A Week", by Rafe Colburn. Until recently, things were going...
6
3766
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 user presses the submit button: <form method="post" name="step1" action="test.html"> <script language="JavaScript"> var position
8
2519
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? Here's my code (CMS and INCHES which is working): <input name="CM" type="text" VALUE="" size="3" maxlength="3" onChange="eval('IN.value = ' +...
9
2196
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 while (This information is just for general knowledge as I don't want anyone thinking I am trying to be dishonest with my intentions. Also, I do...
4
4058
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 has the 'how to' details with the script, explaining stuff. A simple feedback form, that displays something similar to what I'm showing below. I need...
3
1701
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 <? $host="localhost"; // Host name. $db_user="****"; // MySQL username. $db_password="*******"; // MySQL password. $database="cms"; // Database...
15
5860
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 value="50">50 </select> <script language="javascript"> document.write('<input type="hidden" name="amount"'); if (document.test.on0.options.value
10
2260
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 this please. Thanks for your help in advance. The form and script are on the same page. <?php require_once('../Connections/rs_ais.php'); ?> ...
1
47376
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or...
0
7496
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7428
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7941
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7452
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7784
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5071
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1039
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.