I am developing a web application using PHP, Smarty combination, I have wrote a javascript redirect in the .tpl file, but it is not working now. Please take a look at the code and help me to find out the problem.
This is the code segment,
{literal}
<script type="text/javascript">
if(confirm({/literal}'{$info}'{literal})){
window.location = "logbook_client_section.php?e={$ckey}";
}
</script>
{/literal}
Problem is only in the redirect section, it is now redirecting to logbook_client_section_add.php?e={$ckey} , I would like to get the value of $ckey ( smarty variable) in the url.
You are trying to use a
{$var}inside a{literal}block. That cannot work…The cleanest solution to avoid unreadable code caused by closing/opening the
{literal}blocks within your code would be this: