W
William
Perl script in question: http://mkmxg00/cgi/confirmUpload.pl is as
follows:
#!/usr/bin/perl -w
#===============================================================================
# confirmUpload.pl
# once the user clicks "Confirm Modifications", this script picks up the
form's
# newest data from STDIN (POST method), then saves it to the dummylist
#===============================================================================
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use strict;
my $query = new CGI;
# add code that reads in the "Confirm Modifications" request from the CGI
buffer
my $buffer;
read ( STDIN, $buffer, $ENV{'CONTENT_LENGTH'} );
# buffer now contains data to be written to the dummylist
open ( OUTFD, "/mkapp/webapps/mxrt/data/extra_desk_tickers.txt" ) or
error("Couldn't open file: $DATAFILE\n");
print ( OUTFD $buffer );
close ( OUTFD );
exit 0;
The javascript code that invoked the above Perl script:
I am currently using XMLHttpRequest as follows:
function saveText( scroll_list, t_area, listToBeUpdated ) {
var updated = new Option();
updated.value = t_area.value;
updated.text = t_area.text;
for(var i = 0; i < scroll_list.options.length; i++) {
if( scroll_list.options.selected ) {
scroll_list.options[scroll_list.selectedIndex].text = updated.value;
scroll_list.options[scroll_list.selectedIndex].value= updated.value;
break;
}
}
var confirmReq;
var url = "http://mkmxg00/cgi/confirmUpload.pl";
confirmReq = new ActiveXObject( "Microsoft.XMLHTTP" );
confirmReq.onreadystatechange = processReqChange;
confirmReq.open( "POST", url, true );
confirmReq.send( "" );
alert( url );
}
function processReqChange() {
if ( confirmReq.readyState == 4 ) {
if ( confirmReq.status == 200 ) {
alert( "passed!" );
}
}
else {
alert( confirmReq.readyState + ", " + confirmReq.status );
}
}
My problem: nothing is written to
/mkapp/webapps/mxrt/data/extra_desk_tickers.txt
I have already invoked confirmUpload.pl with the XMLHttpRequest confirmReq
(I am using IE 6.0 on Windows XP). Why does the file contains no output
from the CGI buffer?
follows:
#!/usr/bin/perl -w
#===============================================================================
# confirmUpload.pl
# once the user clicks "Confirm Modifications", this script picks up the
form's
# newest data from STDIN (POST method), then saves it to the dummylist
#===============================================================================
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use strict;
my $query = new CGI;
# add code that reads in the "Confirm Modifications" request from the CGI
buffer
my $buffer;
read ( STDIN, $buffer, $ENV{'CONTENT_LENGTH'} );
# buffer now contains data to be written to the dummylist
open ( OUTFD, "/mkapp/webapps/mxrt/data/extra_desk_tickers.txt" ) or
error("Couldn't open file: $DATAFILE\n");
print ( OUTFD $buffer );
close ( OUTFD );
exit 0;
The javascript code that invoked the above Perl script:
I am currently using XMLHttpRequest as follows:
function saveText( scroll_list, t_area, listToBeUpdated ) {
var updated = new Option();
updated.value = t_area.value;
updated.text = t_area.text;
for(var i = 0; i < scroll_list.options.length; i++) {
if( scroll_list.options.selected ) {
scroll_list.options[scroll_list.selectedIndex].text = updated.value;
scroll_list.options[scroll_list.selectedIndex].value= updated.value;
break;
}
}
var confirmReq;
var url = "http://mkmxg00/cgi/confirmUpload.pl";
confirmReq = new ActiveXObject( "Microsoft.XMLHTTP" );
confirmReq.onreadystatechange = processReqChange;
confirmReq.open( "POST", url, true );
confirmReq.send( "" );
alert( url );
}
function processReqChange() {
if ( confirmReq.readyState == 4 ) {
if ( confirmReq.status == 200 ) {
alert( "passed!" );
}
}
else {
alert( confirmReq.readyState + ", " + confirmReq.status );
}
}
My problem: nothing is written to
/mkapp/webapps/mxrt/data/extra_desk_tickers.txt
I have already invoked confirmUpload.pl with the XMLHttpRequest confirmReq
(I am using IE 6.0 on Windows XP). Why does the file contains no output
from the CGI buffer?