bali2003 Posted January 27, 2010 Share Posted January 27, 2010 Hi guys hope you can help me. this string: <a href="{$article.link}?tid=<? echo $_GET['kw']; ?>"> produces this output: http://articlelink.php/?tid=<? echo $_GET['kw']; ?> for some reason the variable 'kw' is not transfered from the link: http://link.php?kw=whatever Any help? Link to comment https://forums.phpfreaks.com/topic/190035-passinggetting-a-variable/ Share on other sites More sharing options...
teamatomic Posted January 27, 2010 Share Posted January 27, 2010 The $article vars displays OK but the get inside the short tags does not. Why if the $article vars needs no short tags does the get need them? There's more than meets the eye here. Some kind of template engine? Read the docs. <a href="{$article.link}?tid=<? echo $_GET['kw']; ?>"> HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/190035-passinggetting-a-variable/#findComment-1002601 Share on other sites More sharing options...
bali2003 Posted January 27, 2010 Author Share Posted January 27, 2010 Actually, I'v just noticed it actually is template file. The template engine probably does not parse PHP in the template. Any workaround? Link to comment https://forums.phpfreaks.com/topic/190035-passinggetting-a-variable/#findComment-1002617 Share on other sites More sharing options...
akitchin Posted January 27, 2010 Share Posted January 27, 2010 well, one thing to try is using proper PHP tags rather than short tags. short tag support was left off by default as of PHP 5, and will probably not even exist in PHP 6: <a href="{$article.link}?tid=<?php echo $_GET['kw']; ?>"> in addition, are your template files given the .php extension? if not, the PHP won't be parsed (unless your server has additional extensions set to parse as PHP). Link to comment https://forums.phpfreaks.com/topic/190035-passinggetting-a-variable/#findComment-1002622 Share on other sites More sharing options...
bali2003 Posted January 27, 2010 Author Share Posted January 27, 2010 proper tags doesn't solve it I guess I'm gonna have to ask the server for a solution?? Link to comment https://forums.phpfreaks.com/topic/190035-passinggetting-a-variable/#findComment-1002628 Share on other sites More sharing options...
akitchin Posted January 27, 2010 Share Posted January 27, 2010 sounds like it - without knowing what template engine you're using or what server environment you're running on, it's difficult to say what the problem is. Link to comment https://forums.phpfreaks.com/topic/190035-passinggetting-a-variable/#findComment-1002633 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.