 |
Smarty
The discussions here are for Smarty, a template engine for the PHP programming language. Dedicated server web hosting provided by Guru-host.eu. |
| View previous topic :: View next topic |
| Author |
Message |
bimal Smarty Elite

Joined: 19 Apr 2007 Posts: 419 Location: Kathmandu, Nepal
|
Posted: Thu Jul 15, 2010 6:32 pm Post subject: Issues with HTML Element Names and Values. |
|
|
I can write HTML Element as:
<input type="text" name="subdomain-name" value="{$smarty.post.subdomain-name}">
I can use $_POST['subdomain-name'] successfully.
You might have guessed the problem now.
I want to keep the same name for the value assigned by Smarty.
{$smarty.post.subdomain-name} is wrong. It tries to subtract, and gives the output: 0.
Can we fix it somehow? (not by using different name to assign ) _________________ Skype: pbimal
To hire instantly as a freelancer - https://www.odesk.com/o/profiles/users/_~~657b70cc7f2c616a/
Visit my website - http://bimal.org.np/ for more articles
800+ screenshots to learn about website mistakes: http://mistakes.sanjaal.com/ |
|
| Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 4177 Location: Hamburg / Germany
|
Posted: Thu Jul 15, 2010 6:53 pm Post subject: |
|
|
You should avoid '-' in POST or GET parameter names. Use
$_POST['subdomain_name'].
Otherwise you have to use workarounds
Smarty2:
{assign var=foo value='subdomain-name'}
{$smarty.post.$foo}
Smarty3
{$smarty.post.{'subdomain-name'}} |
|
| Back to top |
|
bimal Smarty Elite

Joined: 19 Apr 2007 Posts: 419 Location: Kathmandu, Nepal
|
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|