kickinpretty
Technical User
Hi all
i need some help with this its driving me mad...basically i have a cgi that writes a new file when activated. the cgi is as follows...
#!C:\Program Files\Abria Merlin\Perl\bin\perl
require "subparseform.lib";
&Parse_Form;
$n1 = $formdata{'n1'};
@New = ("n1=$n1"
open (LOG, ">\test1.txt" || &ErrorMessage;
print LOG "@New";
close (LOG);
print "Content-type: text/html\n\n";
print "Status=Success - You are now a registered user";
sub ErrorMessage {
print "Content-type: text/html\n\n";
print "Status=Connection Failed Please Check the path to the text File";
exit;
}
This works fine by writing a text file inside the cgi-bin, if i change the following line...
open (LOG, ">\test1.txt" || &ErrorMessage;
to...
open (LOG, ">\\test1.txt" || &ErrorMessage;
It writes a file at C:\ this works fine to, but what i want to do is write a file to a directory called \site the full path to this is...
C:\Program Files\Abria Merlin\Apache\htdocs\site\test1.txt
I have tried every combination of file paths and even tried absolute file paths with no joy.
WHAT AM I DOING WRONG????????
i need some help with this its driving me mad...basically i have a cgi that writes a new file when activated. the cgi is as follows...
#!C:\Program Files\Abria Merlin\Perl\bin\perl
require "subparseform.lib";
&Parse_Form;
$n1 = $formdata{'n1'};
@New = ("n1=$n1"
open (LOG, ">\test1.txt" || &ErrorMessage;
print LOG "@New";
close (LOG);
print "Content-type: text/html\n\n";
print "Status=Success - You are now a registered user";
sub ErrorMessage {
print "Content-type: text/html\n\n";
print "Status=Connection Failed Please Check the path to the text File";
exit;
}
This works fine by writing a text file inside the cgi-bin, if i change the following line...
open (LOG, ">\test1.txt" || &ErrorMessage;
to...
open (LOG, ">\\test1.txt" || &ErrorMessage;
It writes a file at C:\ this works fine to, but what i want to do is write a file to a directory called \site the full path to this is...
C:\Program Files\Abria Merlin\Apache\htdocs\site\test1.txt
I have tried every combination of file paths and even tried absolute file paths with no joy.
WHAT AM I DOING WRONG????????