I have a CGI script that worked perfect for several years that writes
contents of a file from the web on one webserver.
I am setting a new web server, and running this time the same script
but under https instead of http.
The script is very simple:
#!/usr/bin/perl
use CGI;
my $q = new CGI;
print $q->header();
$user = $q->param('user');
$pass = $q->param('pass');
if($user eq "Eduard" && $pass eq "xxxxx"){
$filecontents = $q->param('filecontents');
open(FILE,">/home/server/file.txt") or die;
print FILE $filecontents;
close(FILE);
print "hi $user!";
}
else{print "You are not authorized!"}
So, you provide something like:
http://somewebserver.com/cgi-bin/xxx.cgi?user=Eduard&pass=xxxxx&filecontents=somedatakdfjlsdkf
This way, it should create a file called "file.txt" at the directory /
home/server/file.txt
In the new server under https I do:
https://somewebserver.com/cgi-bin/xxx.cgi?user=Eduard&pass=xxxxx&filecontents=somedatakdfjlsdkf
But now nothing happens. The script writes only once hi Eduard!
The second print is ignored and I am not able to write or modify the
file.
I don't know if this happens because of the https. I've set the
permissions of /home/server dir to 777, and also the same for all
files inside the directory, but
I cannot write a file inside this directory.
What should I do to know what's going wrong?
Any help appreciated!
Best regards,
Alejandro
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs