Welcome to Geeklog, Anonymous Tuesday, June 25 2024 @ 02:01 am 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=\"); 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?

Status: offline


Forum User
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.
Geeklog components by PortalParts -- www.portalparts.com


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!

All times are EDT. The time is now 02:01 am.

  • 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