Welcome to Geeklog, Anonymous Thursday, July 17 2025 @ 03:34 pm EDT
Geeklog Forums
Need help with a PHP Block?
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?
25
22
Quote
Status: offline
Forum User
Moderator
Registered: 07/16/02
Posts: 1232
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.
42
23
Quote
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!
18
26
Quote
All times are EDT. The time is now 03:34 pm.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content