online bidding
| From: | regnivon at netscape dot net | Date: | Mon, 20 May 2002 13:59:47 +0000 |
| Subject: | online bidding | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98455@lists.php.net to get a copy of this message | ||
the following code represents an ineloquent way of capturing data from multiple form fields.
currently, i am capturing the data from 4 fields(e.g. ."Choice 1: ".$line1."\n")
i could have up to 222 inputs when this is completed.
what might be a better way of doing this instead of hardcoding 222 different variables? using and
array? i want to be able to send this information as part of the $bid_information variable. i will
eventually write this info. to a database, but for now, baby steps.
<?
$name=trim($name);
$employee_id=trim($employee_id);
$month=($month);
$aircraft=($aircraft);
$position=($position);
$bid_position=trim($bid_position);
$revision=trim($revision);
$line1=trim($line1);
$line2=trim($line2);
$line3=trim($line3);
$line4=trim($line4);
$contact= "me"; // person to contact for assistance
$toaddress = "me@foo.com"; // the default value
$fromaddress = "From: webmaster@foo.com";
$subject = "Online Bidding";
$bid_information = "Name: ".$name."\n" // all the information from the
line_bid_sheet form.
."Employee ID: ".$employee_id."\n"
."Month: ".$month."\n"
."Aircraft: ".$aircraft."\n"
."Position: ".$position."\n"
."Bid Position: ".$bid_position."\n"
."Revision: ".$revision."\n\n"
."Choice 1: ".$line1."\n"
."Choice 2: ".$line2."\n"
."Choice 3: ".$line3."\n"
."Choice 4: ".$line4."\n";
mail($toaddress, $subject, $bid_information, $fromaddress);
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of
buying online with Shop@Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/