in reply to Re^2: CGI Header Breaks on Second AJAX Call
in thread CGI Header Breaks on Second AJAX Call
I think you get the error message because you called exit() in your reduced example. Don't do that.
If you then still get the HTML with the HTTP headers in the HTML, then maybe try outputting the HTTP status code first:
print "200 OK\r\n"; print $q->header(-status => '200 OK', ...); ...
Apache looks for HTTP headers in the output of your script, and if it doesn't find them, it assumes that your script outputs raw HTML (which your browser then turns into more HTML). So if the above works, then maybe something else is outputting a string via print first, or you need to reconfigure Apache to (not?) want the HTTP status code first from your script.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: CGI Header Breaks on Second AJAX Call
by brandon8696 (Initiate) on Apr 15, 2025 at 21:00 UTC |