You are here: need to convert field names into array for form submission « PHP « IT news, forums, messages
need to convert field names into array for form submission

Posted by Bruce Gilbert on 08/12/05 22:39

How would I organize this block in order to convert it into an array
for my form field names.

For instance if my field has:

<p>Home Phone Number:</p> <input maxlength="6" size="6"
name="area_code" id="area_code" value="{$_POST['area_code']}"> &nbsp;
<input maxlength="6" size="6"
name="phone_exchange" id="phone_exchange"
value="{$_POST['phone_exchange']}"> &nbsp;
<input maxlength="10" size="10"
name="last_4_digits" id="last_4_digits"
value="{$_POST['last_4_digits']}"> &nbsp;

I would want something to return an error stating that the phone
number was not completed and not that the field last_4_digits was not
entered.

I believe this can be done with an array.

my error block code is:

function check($fieldname)
{
global $err_msg;
if($_POST[$fieldname] == "") {
if ( !isset($err_msg)) {
$err_msg = "<div class='red'>You haven't entered
your " . str_replace("_", " ", $fieldname) . "!</div><br />";
} elseif ( isset($err_msg)) {
$err_msg .="<div class='red'>You haven't entered
your " . str_replace("_", " ", $fieldname) . "!</div><br />";
}
}
return $err_msg;
}

any assistance is greatly appreciated!
--
::Bruce::

 

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

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