PHPBB re populating the form with the $_POST data after submit -
i'm creating custom phpbb page. there various text fields in page , there "add ingredient" option. if fields filled in various information , ingredient added, form submitted add ingredient session. page refreshes @ point.
is there simple way re-populate text fields information had via $_post array? know information require in there 30+ fields thinking there must simpler/automated way of doing it, rather adding each individual variable template array , using if statements every field.
thanks :)
found answer myself...
foreach($_post $id=> $row){ $id=strtoupper($id); $template->assign_var($id, $row); }
from there used {id_name} fill in values.
end result was
<!-- if id_name --> <input name="id_name" type="text" id="id_name" tabindex="1" value="<!-- if id_name -->{id_name}<!-- else -->60<!-- endif -->"/>
the lower case name of element changed upper case in order populate it's value.
Comments
Post a Comment