Fearpig Posted October 17, 2006 Share Posted October 17, 2006 Hi guys,This isn't a coding problem more of a method problem...I've set up a page where people can request literature in volumes of 1, 25, 50 or a box. The page scans a database and for each bit of literature it creates a new set of radio buttons so that you can tick either 1, 25, 50 or box for each bit of literature. I then wanted to submit this form as an e-mail to the person responsible. Unfortunately I don't know which variables are going to be passed to the processing page as that depends on which manuals are listed on the form (by which ones are in the database). The form works correctly but I have no idea how to process it as of yet. Can anyone suggest a moethod or tutorial? This has been bugging me for a couple of days now. :-\[code]<p class="Body2">Documentation Request Form </p><form name="LiteratureRequestForm" method="post" action="ProcessingPage.php"><?php $sql="SELECT * FROM BR_01_PRODF_0001 WHERE Product_Group = 'Literature'";$result=odbc_exec($conn,$sql);if (!$result) {exit("Error in SQL");}echo "<table width=250 border=0 class='Body3'>\n";echo "<tr><th class='Body2' align=center bgcolor=#CCCCCC><b>Manuals</b></th></tr>\n"; while (odbc_fetch_row($result)) { $PartNo=odbc_result($result,"BR_PR_PARTNO"); $Description=odbc_result($result,"BR_PR_StockFullDescr"); echo "<tr><td><fieldset> <legend>$Description</legend> <input type='radio' name='$PartNo' value='1' id='1'>1 <input type='radio' name='$PartNo' value='25' id='25'>25 <input type='radio' name='$PartNo' value='50' id='50'>50 <input type='radio' name='$PartNo' value='Box' id='Box'>Box </fieldset></td></tr>\n"; }echo "</table>\n";?></form>[/code]Any help would be appreciated. ;D Quote Link to comment https://forums.phpfreaks.com/topic/24215-difficult-forms-problem/ Share on other sites More sharing options...
HuggieBear Posted October 17, 2006 Share Posted October 17, 2006 On your processing page, just process all of the values like this, that way you have no need to know what the values are:[code]<?phpecho "Please order me the following:\n";foreach ($_POST as $part => $qty){ echo "$part - $qty\n";}?>[/code]RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/24215-difficult-forms-problem/#findComment-110124 Share on other sites More sharing options...
Fearpig Posted October 18, 2006 Author Share Posted October 18, 2006 Huggiebear to the rescue! ;DThank you. Now I just have to work out how to send that as an e-mail. Quote Link to comment https://forums.phpfreaks.com/topic/24215-difficult-forms-problem/#findComment-110518 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.