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?
Passing/getting a variable
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Passing/getting a variable
Most likely your file is .htm or .html? Try changing to .php. Most webservers don't parse .htm, .html files with PHP by default.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Passing/getting a variable
No sorry I've already changed to .php
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Passing/getting a variable
Actually, on second look, it looks like a template file. The template engine probably doesn't parse PHP in the template.bali2002 wrote:No sorry I've already changed to .php
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: Passing/getting a variable
Yes! I hadn't noticed that!
It is a .tpl
Any solution?
Thanks
It is a .tpl
Any solution?
Thanks
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: Passing/getting a variable
This is not PHP, this is a secondary system (template engine, framework, something else). Wherever you set template vars you would set a var kw = $_GET['kw'] and then use {$kw}, or you could try:bali2002 wrote:Yes! I hadn't noticed that!
It is a .tpl
Any solution?
Thanks
Code: Select all
<a href="{$article.link}?tid={$_GET.kw}">mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.