Posted on: 08/30/04 06:09pm
By: shane-o
Hello,
I am trying to create a php block that reads from a text file. I have the following code in lib-custom.php:
function phpblock_spamstats()
{
include 'test.txt';
$retval .= '
htmlasdf';
return $retval;
}
The block reads the file but the output is in the very top left corner of the browser window (above where the geeklog logo.gif displays) not in the block. The html displays properly in the block.
Any assistance is greatly appreciated.
Thank you.
PHP Block Include problem
Posted on: 11/08/04 02:38am
By: Anonymous (Peedy)
Im also having this problem, is there a way around it, im doing a include to a Pic of the day from a remote site. It puts the pic at the top left.
PHP Block Include problem
Posted on: 11/08/04 03:17am
By: cinoz
u can create new block and do what u want through the website... log in as admin n go to block.. there create a new block n insert calling function or what soever there.. u can also arrange ur block n where u want to put ur block.. it's easier there.. including putting a html, php function in it..
PHP Block Include problem
Posted on: 11/08/04 09:30am
By: shane-o
The problem appears when the PHP code is in a new block....
PHP Block Include problem
Posted on: 11/08/04 09:44am
By: ScurvyDawg
Try echo instead of return
Hey you're in Victoria too!!
We should hook up for a coffee sometime talk geeklog.
PHP Block Include problem
Posted on: 11/08/04 02:44pm
By: Dirk
It also depends on what's in the included file. If it's HTML or plain text, it would be displayed. PHP code would be executed. But that block should not display anything itself, it should return whatever it wants to be displayed and Geeklog will then display it (in the proper place).
bye, Dirk
PHP Block Include problem
Posted on: 11/08/04 06:26pm
By: shane-o
The file is a very simple text file. The file was created on the linux system so there shouldn't be any EOL wierdness.
Any other ideas on where I could look or where I might have messed something up?
PHP Block Include problem
Posted on: 11/14/04 05:34pm
By: Anonymous (martin)
Hello,
I am confronted with the same problem. here is how I solved it until I get an answer on why this is not working. I did
function phpblock_foo() {
$content = file_get_contents('http://myurl.com/bar.php');
return $content;
}
PHP Block Include problem
Posted on: 11/15/04 03:13pm
By: Dirk
[QUOTE BY= martin] until I get an answer on why this is not working.[/QUOTE]
See my post above ...