Hello everyone,
I am not a programmer but I am really good at copy pasting

. Anyways, I am trying to create a snippet to make usage of wufoo within modx much simpler. I actually already managed to make it work correctly I am now trying to correctly code the snippet in its proper format and making it somewhat user friendly.
I have come across a very simple problem, yet I can’t make sense of it.
I am declaring variables on top of the snippet like this:
$surveytpl = 'somefile.php'; // This is the PHP File to be used as a template for the Form *REQUIRED
$formname = 'somename'; // This is the Form Name provided by Wufoo Account admin page *REQUIRED
and I am trying to access the above variables within a function in the snippet like this:
// Set the Wufoo Query POST parameters
function setPostParams(){
global $formname;
echo $formname;
}
I’ve removed all the coding in this post since I am testing for now.
The funny thing is that, if I test this as a stand alone PHP file, it works fine. But when I try to do it as a snippet, I always get the empty value as if I was unable to access the variable.
Am I missing something?
Thanks.
Jose R. Lopez