J
Jarson
My JavaScript is trying to POST data to a CGI script (Perl) using
XMLHttpRequest. My CGI server gets different data from IE than Mozilla
Firefox.
// For Mozilla, req = new XMLHttpRequest();
// For IE req = new ActiveXObject("Microsoft.XMLHTTP");
req.onreadystatechange = requestHandler ; // function to handle async
response
req.open('POST', myURL, true); // use POST
req.send('foo=11&bar=22') ;
A Perl CGI script prints the parameters passed to it.
$q = new CGI ;
foreach my $param ($q->param) {
print "$param: " . $q->param($param) . "\n" ;
}
The data received by the CGI script is inconsistent, depending if the client
is IE or Mozilla (Firefox)
Server result from IE client:
foo: 11
bar: 22
Server result from Mozilla Firefox client:
POSTDATA: foo=11&bar=22
It seems that the POST data IE sends is more correct than the Mozilla data.
Is there another way to send the data in Mozilla so the CGI script will give
the same results. I could easily adjust the CGI script, but I think the
problem is at the client.
Jarson (jarson from sygration, that's a dot com company if you need to send
an email)
XMLHttpRequest. My CGI server gets different data from IE than Mozilla
Firefox.
// For Mozilla, req = new XMLHttpRequest();
// For IE req = new ActiveXObject("Microsoft.XMLHTTP");
req.onreadystatechange = requestHandler ; // function to handle async
response
req.open('POST', myURL, true); // use POST
req.send('foo=11&bar=22') ;
A Perl CGI script prints the parameters passed to it.
$q = new CGI ;
foreach my $param ($q->param) {
print "$param: " . $q->param($param) . "\n" ;
}
The data received by the CGI script is inconsistent, depending if the client
is IE or Mozilla (Firefox)
Server result from IE client:
foo: 11
bar: 22
Server result from Mozilla Firefox client:
POSTDATA: foo=11&bar=22
It seems that the POST data IE sends is more correct than the Mozilla data.
Is there another way to send the data in Mozilla so the CGI script will give
the same results. I could easily adjust the CGI script, but I think the
problem is at the client.
Jarson (jarson from sygration, that's a dot com company if you need to send
an email)