[pmwiki-users] Fwd: Case of vanishing FmtPV

Américo Albuquerque aalbuquerque at lanowar.sytes.net
Mon Sep 18 09:40:28 CDT 2006


Hello

On Sun, 17 Sep 2006 19:53:06 -0400, The Editor wrote:
 > Thanks for the suggestion Ian. I thought for sure it was something
 > along these lines when I remembered $log was a global variable used
 > elsewhere, so I rewrote the code to use a different, unique variable.
 > But it still didn't work.
 >
 > As for your question, when I uncomment the first line, I get the right
 > value returned for GetLog. Exactly what I want. When I uncomment the
 > second line I get "hi" exactly where I want. So the page variable is
 > setting right.
 >
 > BUT with both lines commented I get a blank where my value is supposed
 > to be. And there's no intermediary lines that might be messing things
 > up. Any other suggestions?
 >
 > case "logid" :
 > // return GetLog($d,$_GET[logid]);
 > // $FmtPV['$logid'] = "hi";
This works because PHP transforms the constant hi into the string "hi". 
You probably get a notice on your webpage if you have it set on your php.ini
The correct way would be $FmtPV['$logid'] = "'hi'";
Notice the quotes inside the double quotes

 > $FmtPV['$logid'] = GetLog($d,$_GET[logid]);
Your error is here. You have to think inside the string. For this to 
work you have to add quotes around it, something like:
$FmtPV['$logid'] = "'" . GetLog($d,$_GET[logid]) . "'";

This way the variable will have  a string inside

 > break;
 >
 > And as for Ben similar experience, I take it you never solved the
 > problem successfully? Would you be willing to explain the method you
 > used to get the string value into a page if you didn't use page
 > variables? Perhaps I could do something similar. (My second choice).
 > I take it these page variables are just a bit buggy... Well, bug me
 > at least. :)
 >
 > Cheers,
 > Caveman

Regards,
Américo Albuquerque








More information about the pmwiki-users mailing list