Welcome to Geeklog, Anonymous Monday, January 13 2025 @ 10:56 pm EST
Geeklog Forums
Weird PHP behavior
IdahoEv
I'm developing a hack to get geeklog to ping weblogs.com when new stories are submitted, but I came up against a strange bug/unusual PHP behavior in GL that I don't know how to tackle.
I set it up to do it by sending an XML-RPC message; I'm using the XML-RPC for PHP package. Setting up the code was actually pretty easy; I wrote it in a few minutes.
When it didn't work, I tracked the problem down to the fact that xmlrpc functions behave differently (broken) inside GL than they do in a standalone PHP file. I'm hoping someone can tell me where to start looking to figure out why this is happening. I've set up a simple demonstration of this behavior.
If I take the following code snippet:
include("xmlrpc.inc");
$v=new xmlrpcval("foobar","string");
$retval = "value is:
" .
htmlentities($v->serialize()) . "
";
print $retval;
and run it in a PHP file, I get a useful output:
value is:foobar
Yet if I take the same code and put it in a PHP block (changing print $retval to return $retval), I get what appears to be an empty value! This shows, to me that either the xmlrpcval() constructor, or $v->serialize(), or both, are not working correctly inside GL:
value is:
You can see these behaviors in action on my blog. Go to http://www.idahoev.com/vardemo.php for the first behavior in a standalone PHP file. For the second, go to my blog and click on the "Testing Grounds" topic. the lower-right block has the above code in it.
If anyone can suggest where to start looking as to why this code breaks if used inside GL, I'd greatly appreciate it.
Thanks,IdahoEvIdahoEv's Rants: www.idahoev.com
IdahoEv
IdahoEv's Rants: www.idahoev.com
Blaine
Geeklog components by PortalParts -- www.portalparts.com
Anonymous
Anonymous
- 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