You are here: Re: Using a <SELECT> field on a Form « PHP Programming Language « IT news, forums, messages
Re: Using a <SELECT> field on a Form

Posted by Toby A Inkster on 01/03/08 10:14

Rik Wasmus wrote:

> Short of storing the entire result in a session, or as hidden form
> fields, yes, you query that (again). It should have very little overhead
> though.

Another way is to use something like this:


$data = array(
'date_of_birth' => '1980-01-01',
'name' => 'John Smith',
'address' => '123 High Street'
);
printf('<option value="%s">%s</option>',
htmlentities(serialize($data)),
htmlentities($data['name'])
);

And then once the form has been posted:

$data = unserialize($_GET['whatever']);

Don't do that unless you really trust the users though, because the $data
you get back could contain anything!

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 3 days, 21:23.]

Sharing Music with Apple iTunes
http://tobyinkster.co.uk/blog/2007/11/28/itunes-sharing/

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация