[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]
Check out Janggi (Korean Chess), our featured variant for December, 2024.
Check out Janggi (Korean Chess), our featured variant for December, 2024.
I'll have a look at it. fen2.cgi already outputs an image/png Content-Type header, as it expects its output to go directly to the client. But I can make a version that omits this.
[Edit] OK, I now made such a version of fen.cgi that omits the header if it was not called directly by the server, which it can see by the environment variable REQUEST_METHOD not being defined. Apparently the PHP script does not pass the environment to the programs it calls.
Accessed through the web fen2.php now makes a 50x50 white king image appear in the browser.
Problem is that the variable QUERY_STRING is also not passed, so fen2.cgi has no idea what the user was requesting, and puts out the king by default. Is there a way to make the PHP script run fen2.cgi with some environment variables set?
I suppose I could adapt fen2.cgi to accept a command-line argument, and use that as query string when it doesn't find one in the environment. Then fen2.php would just have to append its query string to $command (after a space).