Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows cgi not receiving data from html form

Status
Not open for further replies.

aez

Technical User
Jan 2, 2004
4
US
I have an html form that does seem to execute the ActivePerl code I have on my Windows XP machine, but the cgi does not seem to receive any data from the html form whether I use post or get. Note that the html form and the Perl cgi script are on the same Windows XP machine.

I know the Perl script is running because I have it write to a file as a means of debugging. With this debugging, I write the entire %ENV to the file, and there is no QUERY_STRING.

How can I get the Perl cgi script to see the data?

Thanks,

Tony
 
We need more info to help you. Post your HTML & CGI code so we can see what may the problem(s) may be.

There's always a better way. The fun is trying to find it!
 
Thanks tviman, I should have provided it. This is my first cgi, note that I'm just running this all on a single Windows XP machine, using just IE6.0 and ActivePerl.

Here's the html form:

<html>
<head>
<title> Testing HTML forms</title>
</head>
<body>
Tuesday</font><br>

<form action=&quot;test.pl&quot; method=&quot;GET&quot;>
Radio Button Test <br>
<input type=&quot;radio&quot; name=&quot;dw&quot; value=&quot;done&quot;> Done<br>
<input type=&quot;radio&quot; name=&quot;dw&quot; value=&quot;notdone&quot; checked> Not Done
<input type=&quot;submit&quot; value=&quot;Submit&quot;><br>
</form>
</body>
</html>


and here is the debugging cgi:

#!c:/perl/bin/perl

# test cgi
open(outfile,&quot;>test.txt&quot;);
foreach $key (keys(%ENV)){
print outfile &quot;$ENV{$key}\n&quot;;
}


I never see any QUERY_STRING data in the test file.

Thanks.
 
So it turns out I needed an http server, like Apache. After installing that, I can run html forms that run cgi Perl scripts, so I'm OK, no more problems.

If anyone stumbles on this thread, it might be useful to know that, if you're testing forms and cgi on the same machine, the &quot;action=&quot; part of the form must use before the Apache service will see it.

Thanks,

Tony
 
AEZ,

I have been experiencing the same problem. I guess my question to you is, how did you configure your HTTP server?
I'm not set up to run a fully funtional HTTP server. I just want it configured so that it will handle the CGI scripts sent to it. In short, my Form, CGI script and HTTP server will all run on the same XP box. Any help you could provide would be greatly appreciated.


Thanks
CJCCROPPER
 
Hi cjccropper,

I have the same setup: everything on a single xp machine. I had to do very little, just install Apache HTTP server and ActivePerl for my cgi scripts. ActivePerl has some very handy objects to get the query data from the server. What do you mean &quot;not setup to run a fully functional HTTP server&quot; is there some kind of in-between? What is your HTTP server?

Tony
 
Tony,

Thanks for your reply. I'm also using Apache, version 2.0. What I meant by &quot;fully functional&quot; was that I only intend to run the HTTP server in order to support my developement enviroment. In other words I configured it to run on the loop back ip(127.0.0.1), or as you mentioned LOCALHOST. The initial problem I was having was getting the Apache service to come up. It turned out that problem was being caused by conflicting versions running. See I also have Oracle 9i personnal eddition running, which has a lesser version of apache. I removed the Apache version from Oracle using the Oracle installer. The next problem I had was HTTP error 403, FORBIDDEN. I found that prolem to be caused by an errand line for &quot;SCRIPTALIAS&quot; on my HTTPD.CONF file. Once corrected my CGI scripts ran fine(against the MySQL database). It took me a while to figure out, but I managed to get it right eventually.
Now a new problem evidently occured when I removed the apache service from Oracle. After doing that I could not execute the CGI scripts against the Oracle database. I keep getting a PERL.EXE error saying that the ORACORE9.DLL is missing. I think if I completely remove PERL and reinstall it will be ok.

Thanks again.
Clint
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top