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!

Help - Form

Status
Not open for further replies.

Efoi

Programmer
Apr 14, 2005
4
NO
Im not very experienced with this kind of programming, and of course; I encountered a problem.
First, I installed ActivePerl, then I made a script and web form so I could get new user information from the browser.
The problem I have however is that my scripts doesnt run in the browser... a new "are you sure you want to download this file" window pops up, and it asks me to download the CGI script. I have proberly overlooked something,or set up the server wrong(2003 Server), but I dont know... :(
also the Form GET doesnt send the query's to the header, like
bla bla bla :p
Any help would be much appreciated!
 
Have a look in the FAQ here and in the Perl Forum (219) look for Barbie's post on IIS

Did you set up an mapping/association for IIS when the ActivePerl installer was running?

HTH
--Paul

cigless ...
 
Also, you'll need to set the CGI-BIN directory to allow the running of Scripts. This is not set by default in IIS (for some unknown reason).

- Rieekan
 
Hehe, thanks, I got it to work tho.
The problem was that I was sitting on the server writing the perl stuff, and opened the html files locally and not through the domain name... had too much authority :p
My school project is to make a perl script to automatically update the admin files to give new emails and FTP access to whoever signs up for my pages, but I encountered another problem...
I cant get the perl script to read the lines of a file, or write to it/interact with it... When I run one of my scripts from the server, it works, and reads the lines, but over the domain it doesnt.
Im a newbie with perl, but I tried several modules and did my best, yet no success.
It stores the stuff I want and prints it, decodes it but I cant get it to interact with a file:

use cgi;
use CGI::carp;
$fom = $ENV{QUERY_STRING};
@fv_pairs = split /\&/ , $fom;
foreach $pair (@fv_pairs) {
if($pair=~m/([^=]+)=(.*)/) {
$field = $1;
$value = $2;
$value =~ s/\+/ /g;
$value =~ s/%([\dA-Fa-f]{2})/pack("C", hex($1))/eg;
$fom{$field}=$value;
}
}
$hits = int( (time() - 850_000_000) / rand(1_000) );
print "Content-type: text/html\n\n";
print "<html><head>\n";
print "<title>Takk. $hits</title>\n";
print "</head><body bgcolor=", "#", $hits, "><div>Lines: $lines, Din informasjon er Sendt<br> $fom{navn}&nbsp;";
print "$fom{enavn};</div></body>";
print "</html>";

Umm... as u can see im VERY new :p Just some script to write this to a default data/text file, the format doesnt matter, would be really appreciated. =)
 
I get an error that reports:
CGI ERROR
Not enough HTTP Headers
thats when I try to do
open(FIL,">>database");
print(FIL) "$string1";
close(FIL);
if any1 know....
 
Never mind! got it to work now after alot of testing :p Thanks for the earlier replies!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top