/    Sign up×
Community /Pin to ProfileBookmark

Help Form Processing info from one page to the other

Ok!!! I know I’m being a noob asking this. I’ve been programming in php, on and off for the past year. I’m at the stage where I’m trying to create an order form where 2 things happen. Viewing the order before submitting and parsing it for email. I’m kinda okay with the email for now but really need help on this lil project.

1) Where only the items that are selected on the order form is passed to the next page that I call the validation page before being pass to the processing page. This is a sample code of what I’m working with.

<table width=”118%” style=”width: 100%”>
<tr>
<td style=”width: 280px”>&nbsp;</td>
<td class=”style31″ style=”width: 50px”><br class=”style28″ />
<span class=”style28″>Units</span></td>
<td class=”style31″ style=”width: 50px”><br class=”style28″ />
<span class=”style28″>Cases</span></td>
<td style=”width: 25px”>&nbsp;</td>
<td style=”width: 266px”>&nbsp;</td>
<td class=”style31″ style=”width: 50px”><br class=”style28″ />
<span class=”style28″>Units</span></td>
<td class=”style31″ style=”width: 50px”><br class=”style14″ />
<span class=”style14″>Cases</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td class=”style34″ style=”width: 280px”>Order 115</td>
<td class=”style32″ style=”width: 50px”>
<input name=”order115_units” type=”text” id=”order115_units” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127units()” style=”height: 16px; width: 29px” class=”style34″ /></td>
<td class=”style32″ style=”width: 50px”>
<input name=”order115_cases” type=”text” id=”order115_cases” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127cases()” style=”height: 15px; width: 29px” class=”style34″ /></td>
<td class=”style34″ style=”width: 25px”>&nbsp;</td>
<td class=”style34″ style=”width: 266px”>Order 116</td>
<td class=”style32″ style=”width: 50px”>
<input name=”order116_units” type=”text” id=”order116_units” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127units()” style=”height: 16px; width: 29px” class=”style34″ /></td>
<td class=”style32″ style=”width: 50px”>
<input name=”order116_cases” type=”text” id=”order116_cases” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127cases()” style=”height: 15px; width: 29px” class=”style34″ /></td>
<td class=”style34″>&nbsp;</td>
</tr>
<tr>
<td class=”style34″ style=”width: 280px”>Order 117</td>
<td class=”style32″ style=”width: 50px”>
<input name=”order117_units” type=”text” id=”order117_units” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127units()” style=”height: 16px; width: 29px” class=”style34″ /></td>
<td class=”style32″ style=”width: 50px”>
<input name=”order117_cases” type=”text” id=”order117_cases” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127cases()” style=”height: 15px; width: 29px” class=”style34″ /></td>
<td class=”style34″ style=”width: 25px”>&nbsp;</td>
<td class=”style34″ style=”width: 266px”>Order 118 </td>
<td class=”style32″ style=”width: 50px”>
<input name=”order118_units” type=”text” id=”order118_units” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127units()” style=”height: 16px; width: 29px” class=”style34″ /></td>
<td class=”style32″ style=”width: 50px”>
<input name=”order118_cases” type=”text” id=”order118_cases” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127cases()” style=”height: 15px; width: 29px” class=”style34″ /></td>
<td class=”style34″>&nbsp;</td>
</tr>
<tr>
<td class=”style34″ style=”width: 280px”>Order 119</td>
<td class=”style32″ style=”width: 50px”>
<input name=”order119_units” type=”text” id=”order119_units” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127units()” style=”height: 16px; width: 29px” class=”style34″ /></td>
<td class=”style32″ style=”width: 50px”>
<input name=”order119_cases” type=”text” id=”order119_cases” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127cases()” style=”height: 15px; width: 29px” class=”style34″ /></td>
<td class=”style34″ style=”width: 25px”>&nbsp;</td>
<td class=”style34″ style=”width: 266px”>Order 120</td>
<td class=”style32″ style=”width: 50px”>
<input name=”order120_units” type=”text” id=”order120_units” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127units()” style=”height: 16px; width: 29px” class=”style34″ /></td>
<td class=”style32″ style=”width: 50px”>
<input name=”order120_cases” type=”text” id=”order120_cases” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127cases()” style=”height: 15px; width: 29px” class=”style34″ /></td>
<td class=”style34″>&nbsp;</td>
</tr>
<tr>
<td class=”style34″ style=”width: 280px”>Order 121</td>
<td class=”style32″ style=”width: 50px”>
<input name=”order121_units” type=”text” id=”order121_units” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127units()” style=”height: 16px; width: 29px” class=”style34″ /></td>
<td class=”style32″ style=”width: 50px”><span class=”style32″ style=”width: 50px”>
<input name=”order121_cases” type=”text” id=”order121_cases” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127cases()” style=”height: 15px; width: 29px” class=”style34″ />
</span></td>
<td class=”style34″ style=”width: 25px”>&nbsp;</td>
<td class=”style34″ style=”width: 266px”>Order 126</td>
<td class=”style32″ style=”width: 50px”>
<input name=”order126_units” type=”text” id=”order126_units” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127units()” style=”height: 16px; width: 29px” class=”style34″ /></td>
<td class=”style32″ style=”width: 50px”>
<input name=”order126_cases” type=”text” id=”order126_cases” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127cases()” style=”height: 15px; width: 29px” class=”style34″ /></td>
<td class=”style34″>&nbsp;</td>
</tr>
<tr>
<td class=”style34″ style=”width: 280px”>Order 127</td>
<td class=”style32″ style=”width: 50px”>
<input name=”order127_units” type=”text” id=”order127_units” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127units()” style=”height: 16px; width: 29px” class=”style34″ /></td>
<td class=”style32″ style=”width: 50px”>
<input name=”order127_cases” type=”text” id=”order127_cases” value=”0″ size=”4″ maxlength=”4″
onblur=”order115_127cases()” style=”height: 15px; width: 29px” class=”style34″ /></td>
<td class=”style34″ style=”width: 25px”>&nbsp;</td>
<td class=”style34″ style=”width: 266px”>&nbsp;</td>
<td class=”style32″ style=”width: 50px”>&nbsp;</td>
<td class=”style32″ style=”width: 50px”>&nbsp;</td>
<td class=”style34″>&nbsp;</td>
</tr>
<tr>
<td class=”style33″ style=”width: 280px”>
<span class=”style34″>Units</span>
<input name=”UNITS115_UNITS127″ type=”text” value=”0″ size=”4″ maxlength=”4″ style=”width: 29px; height: 16px;”
class=”style34″ />
<span class=”style5″>=
<input name=”UNITS115_127total” type=”text” id=”UNITS115_127total” onfocus=”order115_127units()” value=”0″ size=”4″
maxlength=”4″ style=”width: 29px; height: 16px;” class=”style34″ />
<input type=”hidden” name=”units115_127″ value=”0″ id=”units115_127″ />
<input type=”hidden” name=”UNITS115_127″ value=”36″ id=”UNITS115_127″ />
<span class=”style36″>Cases</span></span>
</td>
<td class=”style32″ style=”width: 50px”>&nbsp;</td>
<td class=”style32″ style=”width: 50px”>&nbsp;</td>
<td class=”style34″ style=”width: 25px”>&nbsp;</td>
<td class=”style33″ style=”width: 266px”>
<span class=”style34″>Whole Case </span>
<input name=”CASES115_CASES127″ type=”text” value=”0″ size=”4″ maxlength=”4″ style=”width: 29px; height: 16px;”
class=”style34″ />
<input name=”CASES115_127total” type=”hidden” id=”CASES115_127total” onfocus=”order115_127cases()” value=”0″ size=”4″
maxlength=”4″ style=”width: 29px; height: 16px;” class=”style34″ />
<input type=”hidden” name=”cases115_127″ value=”0″ id=”cases115_127″ />
<input type=”hidden” name=”CASES115_127″ value=”36″ id=”CASES115_127″ />
</td>

<td class=”style32″ style=”width: 50px”>&nbsp;</td>
<td class=”style32″ style=”width: 50px”>&nbsp;</td>
<td class=”style34″>&nbsp;</td>
</tr>
</table>

I’m helping out a local non profit org by doing their website “and earning points on my resume” when I get it completed. So my question is how do I parse this information with php. The original order.php I used was just to email me the order but I’m trying to create it for whoever the client is will be able to view the order before submitting it for processing.

Any help at all whether comments or critique is welcome. I’ve got to learn somehow. So thanks to all.

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@weenisOct 28.2009 — It's kind of hard to read through your markup, but the way you usually do an "order review" kind of page is submit that form to a page that accepts the $_POST variables.

Then using those $_POST variables, write your order review page as you would like (echoing the $_POSTs where they need to be echoed). Then also use the $_POST variables to write a bunch of hidden input types that basically repeat the $_POST information from the previous form. Then the "Confirm Order" button submits all the hidden input fields to the form processing script to actually place the order.

So very very simply, if a customer ordered a shirt and gave their e-mail address, the form would be submitted to a page that looks something like this:

&lt;?
echo "Selected shirt: ".$_POST["shirt"]."&lt;br/&gt;n";
echo "Your e-mail: ".$_POST["email"]."&lt;br/&gt;n";

echo "&lt;form action="placeorder.php" method="post"&gt;n";
echo "&lt;input type="hidden" name="shirt" value="".htmlentities($_POST["shirt"])."" /&gt;n";
echo "&lt;input type="hidden" name="email" value="".htmlentities($_POST["email"])."" /&gt;n";
echo "&lt;input type="submit" value="Confirm and Place Your Order" /&gt;n";
echo "&lt;/form&gt;n";
×

Success!

Help @ghost2012 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...