Re: [SMARTY] Quick question about checking form post variables / arrays

From: Date: Sun, 28 Jul 2002 18:32:26 +0000
Subject: Re: [SMARTY] Quick question about checking form post variables / arrays
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-5479@lists.php.net to get a copy of this message
On Sun, 28 Jul 2002, Sheldon Jones - Admin wrote: > On Sat, Jul 27, 2002 at 11:57:12PM -0400, Joao Prado Maia wrote: > > I've been trying to figure out how to do what I'll explain here, but with > > no success. If anyone can shed some light into this it would be very > > appreciated. > > > > Ok, so in HTML you can just name your form elements field[] and that field > > is turned into an array automatically on your PHP script. What I have been > > trying to do is the following: > > > > <select name="category[]" multiple size="3"> > > {section name="y" loop=$cats} > <option value="{$cats[y].cat_id}" > {if $id eq $cats[y].cat_id}SELECTED{/if}>{$cats[y].cat_title}</option> > > {/section} > > </select> > > Where $id is the value you want selected. > Huh? Where's $id coming from ? I have a $category variable in there, and that's an array. Please read the original email again... -- João Prado Maia <jpm@phpbrasil.com> http://phpbrasil.com - php com um jeitinho brasileiro -- Precisando de consultoria em desenvolvimento para a Internet ? Impleo - http://impleo.net/?lang=br -- Leia mais sobre os nossos serviços e produtos http://impleo.net/products.php?lang=br

« previous php.smarty.general (#5479) next »