You are here: Re: [PHP] regarding form submission and option pull down menu « PHP « IT news, forums, messages
Re: [PHP] regarding form submission and option pull down menu

Posted by John Nichel on 08/02/05 17:14

Bruce Gilbert wrote:
> a few more questions about the submission process for a form with
> option choices.
>
> say I am using :
>
> <form method="POST" action="$_SERVER['PHP_SELF']" class="application">
> <select class="checkbox"
> name="loan_process">
> <option value="Purchase"
> selected="selected">Purchase</option>
> <option
> value="construct_home">Construct Home</option>
> <option
> value="refinance_no_cash">Refinance - No Cash</option>
> <option
> value="refinance_cash_out">Refinance - Cash
> Out</option>
> </select>
> </form>
>
> is it better to use a name for value (the same as the selection
> choice) or a number 1,2,3 etc? (or does it matter).

Doesn't matter. You're the one processing it on the back end, so
whatever works for you.

> and for the return info what's the difference between:
>
> <?php
>
> if(isset($_POST["loan_process"]))
> echo $_POST["loan_process"];
> ?>
>
> and without the isset?

In your above example, nothing, other than it will issue a notice for an
undefined variable if you have error reporting set that high. However
it's a good practice to check if something exists (and has the data you
expect) before you process that data.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
john@kegworks.com

 

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

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