开发者

Can't echo variable

开发者 https://www.devze.com 2023-02-11 09:13 出处:网络
I\'m thinking it\'s the smarty templates setup that is preventing me from echo\'ing the $setlnk variable elsewhere on the page. Or, am i\'m doing something else wrong. Is there another method I could

I'm thinking it's the smarty templates setup that is preventing me from echo'ing the $setlnk variable elsewhere on the page. Or, am i'm doing something else wrong. Is there another method I could use?

<?php
$setlnk = "<img src='/files/pvtexp.php?mid=" . $set[2] . "&iid=" . $set[3] . "&idat=" . $set[4] . "/" . $set[5] . "&sec=" . $set[6] . "'>";       

echo $setlnk; //开发者_开发问答 works

?>

..... html code

<?=$setlnk;?> // doesn't work
<?php echo $setlnk; ?> // doesn't work


if this is a smarty template, you need to do the following:

  • PHP file: $template->assign('setlnk', $setlnk); // template is the SMARTY template object
  • TPL file (smarty template): {$setlnk}
0

精彩评论

暂无评论...
验证码 换一张
取 消