Posted on: 07/30/03 08:04pm
By: Anonymous (Ion)
So aside from being a newb, I\'m currently trying to implement a Counter-Strike Server Query system into my GL site. The data is created and sent to the browser in html form when i call the link pquery.pl.
So what I tried to do was create a php block and do this:
function phpblock_serverquery()
{
$display .= include(\"cgi-bin/pquery.pl?server=192.168.1.25:27015\");
return $display;
}
and It outputed the stuff correctly enough, but not where i thought it would have gone.
In the block was printed \"1\"
and all of the text that I was hoping would go into the block was writen above the main story.
Any help/ideas?
Re:Need help with a PHP Block?
Posted on: 07/30/03 10:59pm
By: Blaine
Your include is actually executing the query and since it does not look like that perl script is a function it won\'t return anything. It looks to have been written to echo or print its results.
I wonder if you used the PHP Output buffering feature - it may then capture it and let you return it to the block handling code.
Refer to
this section of the php manual.
Re:Need help with a PHP Block?
Posted on: 07/31/03 09:01pm
By: Anonymous (Ion)
Thanks for putting me on track!
I had to end up using
$display = ob_get_contents();
Wow, I never thought I\'d be able to implement a server query tool into GL, but woot! I am good for somethin!