Hi,
I have a PHP function. iam calling this function in all my templates. so i created templates goup for php pages called “snipets” and created one page under snipets called “countryurl” the code is below for the page is
<?php
function country_url(){
$u = explode('/', $_SERVER['REQUEST_URI']);
$u[2];
$x=$u[2];
echo $x;
}
?>
now iam embedding this template on my index page template the code is
{embed="snipets/countryurl"}
<html>
<head>
</head>
<body>
<a href="<?php country_url();?>">
</body>
</html>
iam trying to execute my function through my index template but this is not woking.
if i put the code in the templates it working like this
<?php
function country_url(){
$u = explode('/', $_SERVER['REQUEST_URI']);
$u[2];
$x=$u[2];
echo $x;
}
<html>
<head>
</head>
<body>
<a href="<?php country_url();?>">
</body>
</html>Help needed.