how to include module call in UDT IF statement
Posted: Wed Jun 06, 2007 8:09 pm
Greetings,
I have a UDT that looks something like this:
------------------------------
$test = $_GET['test'];
if($test == "basic"){
echo "{cms_module module='Quizzard' quiz_id='5'}";
}
------------------------------
This UDT is supposed to get the "test" variable from the URL, and if the "test" variable equals "basic", then the UDT should call the Quizzard module, quiz #5. Instead, unfortunately, the UDT simply prints "{cms_module module='Quizzard' quiz_id='5'}" on the page, readable by the visitor.
How can I get the UDT to interpret the module tag correctly so that it calls the module instead of printing text? I've also tried this variant of the code above, but I just get an "invalid code" error.
-------------------------------
$test = $_GET['test'];
if($test == "basic"){
{cms_module module='Quizzard' quiz_id='5'};
}
------------------------------
I also tried:
-----------------------------
$test = $_GET['test'];
if($test == "basic"){
echo "{cms_module module='Quizzard' quiz_id='5'}";
}
----------------------------
which doesn't throw errors, but also doesn't do anything at all on the page where I call the UDT.
Would appreciate any help. I think there must be a simple solution, but I'm an absolute newbie to PHP/Smarty coding and I have no idea where to start.
I have a UDT that looks something like this:
------------------------------
$test = $_GET['test'];
if($test == "basic"){
echo "{cms_module module='Quizzard' quiz_id='5'}";
}
------------------------------
This UDT is supposed to get the "test" variable from the URL, and if the "test" variable equals "basic", then the UDT should call the Quizzard module, quiz #5. Instead, unfortunately, the UDT simply prints "{cms_module module='Quizzard' quiz_id='5'}" on the page, readable by the visitor.
How can I get the UDT to interpret the module tag correctly so that it calls the module instead of printing text? I've also tried this variant of the code above, but I just get an "invalid code" error.
-------------------------------
$test = $_GET['test'];
if($test == "basic"){
{cms_module module='Quizzard' quiz_id='5'};
}
------------------------------
I also tried:
-----------------------------
$test = $_GET['test'];
if($test == "basic"){
echo "{cms_module module='Quizzard' quiz_id='5'}";
}
----------------------------
which doesn't throw errors, but also doesn't do anything at all on the page where I call the UDT.
Would appreciate any help. I think there must be a simple solution, but I'm an absolute newbie to PHP/Smarty coding and I have no idea where to start.