ok, now that I've got Perl working on my Microsoft Server I'm now able to run my Form program. Only problem is a slight bug. <br><br>What I would like to do is submit a form that has a 'lastname', 'password', and 'request' to a perl program which takes the users input and store it in a file that has a file name equal to the 'lastname' variable.<br><br>The output of the program as currently written is "success11" and it is stored in a file with the name of '1'.<br><br>clearly the cgi script is able to obtain the data from the form.<br><br>The script works in unix....can anyone help out here?<br><br>thanks very much....<br><br>Jerry<br><br><br>=============================<br><br>Here is the file "example2.pl" on the NT server:<br><br><br><br>&get_form_data;<br>print "Content-type: text/html\n\n";<br><br>$file="$FORM{'lastname'}"¦¦print "Failed to assign $file,$!<BR>\n";<br>$password="$FORM{'password'}"¦¦print "Unable to assign<br>$password,$!<BR>/n";<br>$request="$FORM{'request'}"¦¦print "Unable to assign $password,$!<BR>/n";<br>open(OUT,">$file"
¦¦print "Failed to open $file,$!<BR>\n";<br><br>print "<HTML>\n<BODY>\n";<br>print "</BODY>\n";<br>print"<p>Your data has been successfully sent to the web<br>server\n</p>";<br>print OUT "success";<br>print OUT $lastname;<br>print OUT $password;<br>print OUT $request;<br>close(OUT)¦¦print "Failed to close $file, $!<BR?\n";<br>exit;<br><br><br>sub get_form_data<br>{<br> #Get the input<br> read(STDIN, $buffer, $ENV{ 'CONTENT_LENGTH' } );<br> #Split the name-value pairs<br> @pairs = split(/&/, $buffer);<br> foreach $pair (@pairs)<br> {<br> ($name, $value) = split(/=/, $pair);<br> # Un-webify plus signs and %-encoding<br> $value =~ tr/+/ /;<br> $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;<br> $value =~ s/<v!--(.¦\n)*-->//g;<br> $FORM{ $name } = $value;<br> }<br>}<br><br><br>Here is HTML program that references the above CGI file:<br><br><br><html><br><br><head><br><meta http-equiv="Content-Language" content="en-us"><br><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><br><meta name="GENERATOR" content="Microsoft FrontPage 4.0"><br><meta name="ProgId" content="FrontPage.Editor.Document"><br><title>New Page 1</title><br></head><br><br><body><br><br><form method="POST" action="cgi-bin/example2.pl"><br> <p>Lastname: <input type="text" name="lastname" size="20"></p><br> <p>Password: <input type="text" name="password" size="20"></p><br> <p>Request: <input type="text" name="request" size="20"></p><br> <p> </p><br> <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p><br></form><br><br></body><br><br></html><br><br>