Welcome to Geeklog, Anonymous Tuesday, December 10 2024 @ 04:32 pm EST
Geeklog Forums
Need help with a PHP Block?
Ion
Anonymous
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?
11
8
Quote
Status: offline
Blaine
Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
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.
Geeklog components by PortalParts -- www.portalparts.com
Geeklog components by PortalParts -- www.portalparts.com
26
9
Quote
Ion
Anonymous
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!
8
11
Quote
All times are EST. The time is now 04:32 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