Results 1 to 2 of 2
Mar 2, 2012, 06:22 #1
- Join Date
- Jun 2008
- Andy lives in London, UK
- 0 Post(s)
- 0 Thread(s)
Quick question on making sticky form values when form uses arays in values
Here is my form:
<label for="aId">This is an input box</label><input type="text" value=" " maxlength="40" class="aClass" id="aId" name="affiliate_hoover_plugin_options[aName]"/>
Array ( [affiliate_hoover_plugin_options] => Array ( [aName] => Here is a value ) )
As expected this works great if an array isn't used:
isset($_POST[$name]) ? print $_POST[$name] : null;
isset($_POST[$option_name[$name]]) ? print $_POST[$option_name[$name]] : null;
Let everyday be Christmas
Mar 2, 2012, 11:36 #2
You can simply print $_POST[$option_name[$name]], there's no need to a ternary operator. If there's nothing in that variable, it will echo nothing anyway.
I also don't understand your usage of the term "sticky."
However, the code you presented is valid and works fine with arrays, so it's not the syntax that's the problem.