Renaming form fields

i don’t think i have it right. i’m kinda green to this stuff so would someone point me in the right direction? i thought i had the form fields correct on the code side but i was wrong. could someone please tell me which are the applicable field names? i have been trying to substitute the names with the field names i want to be there (description, temple, quantity, price) so i can pass the values to php. can anyone help me get on the right track? thanks, yall. i thought i had the right form field names but i was wrong. if anyone cares to consider my situation the url is: solutionm3.com/ordertest.html
this is the html:

<form id="shoppingCart" method="POST" class="form-inline" name="basket_form" action="MyConnection">
				<div class="content">
                    <div class="navbar">
                        <div class="navbar-inner">
                            <ul class="nav custom_nav">
                                <li class="pull-left">
                                    <div>
                                            <i class="icon-hand-left icon-white"></i>
                                            Continue Shopping
                                        </a>
                                    </div>
                                </li>
                   <li class="pull-right">
        <span class="btn btn-success continue_to_checkout" type="submit" value="Checkout" name="cont_to_checkout1">
            Continue To Checkout
        </span>
    </a>
</li>
                                <li class="pull-right">&nbsp;&nbsp;</li>
                                <li class="pull-right">
                                    <div>
                                        <button class="btn btn-danger remove_all" type="submit" name="remove_all1" value="remove_all" rel="tooltip" data-placement="bottom" data-original-title="Be careful! All products will be entirely removed from the basket!">
                                            <i class="icon-remove icon-white"></i>
                                            Remove All
                                        </button>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
					<div class="basket_list clearfix">
						<div class="tables">
						  <table class="table table_header">
								<thead>
									<tr>
										<th colspan="2" class="description">
											Item Description
										</th>
										<th class="size">
											TEMPLE
										</th>
										
								  <th class="quantity">
											Quantity
									  </th>
										<th class="price">
											Price
										</th>
										<th class="subtotal">
											Subtotal
                  </th>
										<th>&nbsp;
											
										</th>
									</tr>
								</thead>
							</table>
							<table class="table">
								<tbody>
									<tr class="warning">
										<td class="thumb" rowspan="2"><a href="javascript: void(0);" title="Link to product page"><img src="img/331.jpg" alt="" width="123" height="91" title="Product Image"></a></td>
										<td class="description" rowspan="2">
											<a class="item-name" href="javascript: void(0);" title="Link to product page">The Carat</a>
											<div>
												<div class="item-availability"><em>These Diamond Shape Spectacles Accentuate Anyone's Style and Grace</em>.</div>
												<div class="item-sku">MDL331</div>
											</div>
										</td>
										<td class="size">
                                            <select class="span2" id="prod2_size1" name="prod2_size1">
												<option value="0">Size</option>
												<option value="Buffalo Horn" selected>Buffalo Horn</option>
												<option value="Gold">Gold</option>
												<option value="Rose Gold">Rose Gold</option>
												<option value="White Gold">White Gold</option>
												<option value="Titanium">Titanium</option>
												<option value="Platinum">Platinum</option>
												<option value="Whale Bone">Whale Bone</option>
                                            </select> 
								    </td>
										<td class="color">


											<input type="hidden" id="prod2_color1" name="prod2_color1" value="no">
										</td>
								  <td class="quantity">Qty:								    <input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini">
							      </td>
										<td class="price">
											<span class="currency">$</span><span class="amount">3000.00</span>
										</td>
										<td class="subtotal">
											<span class="currency">$</span><span class="amount">3000.00</span>
										</td>
										<td class="remove">
                                            <button class="btn btn-danger btn-mini" type="submit" name="prod2_remove1" value="remove_item" rel="tooltip" data-placement="left" data-original-title="Be careful! This item will be entirely removed from the basket!">
                                                <i class="icon-remove icon-white"></i>
                                            </button>
										</td>
									</tr>
									<tr class="warning additional_empty">
										<td class="empty_td" colspan="8">
											
										</td>
									</tr>
							  </tbody>
					    </table>
                                                                   <table class="table">
							  <tbody>
									<tr class="warning">
										<td class="thumb" rowspan="2">
									  <a href="javascript: void(0);" title="Link to product page"><img src="img/332.JPG" width="123" height="91"></a></td>
										<td rowspan="2" class="description">
											<a class="item-name" href="javascript: void(0);" title="Link to product page">The Minimum</a>
											<div>
												<div class="item-availability">
												  <p><em>Timeless Design, </em><em>A true work of art</em>, <em>High Quality Lenses, </em><em>A Comfortable Fit</em></p>
</div>
												<div class="item-sku">MDL332</div>
											</div>
										</td>
										<td class="size">
                                          <select class="span2" id="prod2_size1" name="prod2_size1">
												<option value="0">Size</option>
												<option value="Buffalo Horn" selected>Buffalo Horn</option>
												<option value="Gold">Gold</option>
												<option value="Rose Gold">Rose Gold</option>
												<option value="White Gold">White Gold</option>
												<option value="Titanium">Titanium</option>
												<option value="Platinum">Platinum</option>
												<option value="Whale Bone">Whale Bone</option>
                                            </select>
										</td>
										<td class="color"><input type="hidden" id="prod2_color1" name="prod2_color1" value="no">
									  </td>
								  <td class="quantity">Qty:								    <input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini">
							      </td>
										<td class="price">
											<span class="currency">$</span><span class="amount">4000.00</span>
										</td>
										<td class="subtotal">
											<span class="currency">$</span><span class="amount">4000.00</span>
										</td>
										<td class="remove">
                                            <button class="btn btn-danger btn-mini" type="submit" name="prod2_remove1" value="remove_item" rel="tooltip" data-placement="left" data-original-title="Be careful! This item will be entirely removed from the basket!">
                                                <i class="icon-remove icon-white"></i>
                                            </button>
										</td>
									</tr>
									<tr class="warning additional_empty">
										<td class="empty_td" colspan="8">
											
									  </td>
									</tr>
							  </tbody>
					    </table>
                        
                        
                        <table class="table">
						  <tbody>
									<tr class="warning">
										<td class="thumb" rowspan="2">
											<a href="javascript: void(0);" title="Link to product page">
												<img src="img/333.jpg" width="123" height="91" title="Product Image">
											</a>
    </td>
										<td class="description" rowspan="2">
											<a class="item-name" href="javascript: void(0);" title="Link to product page">The Maximum</a>
											<div>
												<div class="item-availability"><em>Rimless frames</em>, <em> Sophistication &amp;  Elegance</em> by Design</div>
												<div class="item-sku">MDL333</div>
											</div>
										</td>
										<td class="size">
                                            <select class="span2" id="prod2_size1" name="prod2_size1">
												<option value="0">Size</option>
												<option value="Buffalo Horn" selected>Buffalo Horn</option>
												<option value="Gold">Gold</option>
												<option value="Rose Gold">Rose Gold</option>
												<option value="White Gold">White Gold</option>
												<option value="Titanium">Titanium</option>
												<option value="Platinum">Platinum</option>
												<option value="Whale Bone">Whale Bone</option>
                                            </select>
										</td>
										<td class="color"><input type="hidden" id="prod2_color1" name="prod2_color1" value="no">
									  </td>
										<td class="quantity"><label class="inline">Qty:</label><input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini">
										</td>
										<td class="price">
											<span class="currency">$</span><span class="amount">5000.00</span>
										</td>
										<td class="subtotal">
											<span class="currency">$</span><span class="amount">5000.00</span>
										</td>
										<td class="remove">
                                            <button class="btn btn-danger btn-mini" type="submit" name="prod2_remove1" value="remove_item" rel="tooltip" data-placement="left" data-original-title="Be careful! This item will be entirely removed from the basket!">
                                                <i class="icon-remove icon-white"></i>
                                            </button>
										</td>
									</tr>
									<tr class="warning additional_empty">
										<td class="empty_td" colspan="8">
											
									  </td>
									</tr>
							  </tbody>
					    </table>
                                            
                        <table class="table">
<tbody>
							    <tr class="warning">
							      <td class="thumb" rowspan="2"><a href="javascript: void(0);" title="Link to product page"></a><img src="img/POV_clip_image001.jpg" width="142" height="106"></td>
							      <td class="description" rowspan="2"><a class="item-name" href="javascript: void(0);" title="Link to product page">The Drop</a>
							        <div>
							          <div class="item-availability"><em>These Teardrop Cut Lenses with Lightweight Rimless frames are a work of art</em></div>
							          <div class="item-sku">MDL334</div>
						            </div></td>
							      <td class="size"><select class="span2" id="prod2_size3" name="prod2_size3">
							        <option value="0">Size</option>
							        <option value="Buffalo Horn" selected>Buffalo Horn</option>
							        <option value="Gold">Gold</option>
							        <option value="Rose Gold">Rose Gold</option>
							        <option value="White Gold">White Gold</option>
							        <option value="Titanium">Titanium</option>
							        <option value="Platinum">Platinum</option>
							        <option value="Whale Bone">Whale Bone</option>
							        </select></td>
							      <td class="color"><input type="hidden" id="prod2_color3" name="prod2_color3" value="no"></td>
							      <td class="quantity"><label class="inline">Qty:</label>
							        <input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini"></td>
							      <td class="price"><span class="currency">$</span><span class="amount">6000.00</span></td>
							      <td class="subtotal"><span class="currency">$</span><span class="amount">6000.00</span></td>
							      <td class="remove"><button class="btn btn-danger btn-mini" type="submit" name="prod2_remove1" value="remove_item" rel="tooltip" data-placement="left" data-original-title="Be careful! This item will be entirely removed from the basket!"> <i class="icon-remove icon-white"></i> </button></td>
						        </tr>
							    <tr class="warning additional_empty">
							      <td class="empty_td" colspan="8"></td>
						        </tr>
					      </tbody>
						  </table>
						</div>
						<div class="empty_basket">
							Your Shopping Cart is empty!
						</div>
						<div class="order_blocks clearfix">
							<div class="row">
								<div class="span6 shipping_block clearfix">
									<div class="delivery_block pull-left">
										<h4>Delivery Method</h4>
										<label class="radio">
											<input type="radio" name="deliveryOption" id="deliveryOption1" value="0" checked>
											STANDARD - 4-5 working days: <span class="currency">$</span>0.00
										</label>
										<label class="radio">
											<input type="radio" name="deliveryOption" id="deliveryOption2" value="9.95">
											EXPRESS DELIVERY - 48h: <span class="currency">$</span>9.95
										</label>
									</div>
									<div class="promotional_block pull-right">
										<h4>Promotional Code</h4>
										<div class="input-append">
											<input class="span2" id="appendedInputButton" name="promotional" value="" size="16" type="text" >
											<button class="btn" type="submit" formaction="demo_admin.html" id="promotionAdd" rel="tooltip" data-placement="bottom" data-original-title="If you have a promotional code - you could add it here.">Add</button>
										</div>
										<h6>(Use any text here and you'll receive 10% of discount!)</h6>
									</div>
								</div>
								<div class="span6 total_block">
									<h4>Summary Block</h4>
									<table id="basketTotalsList">
										<tbody>
											<tr>
												<td class="total_position">Goods Subtotal</td>
												<td class="basket_subtotal">
													<span class="currency">$</span><span class="amount">325.67</span>
												</td>
											</tr>
											<tr>
												<td class="total_position">Taxes (<span class="taxes_percent">0</span>%)</td>
												<td class="basket_taxes">
													<span class="currency">$</span><span class="amount">325.67</span>
												</td>
											</tr>
											<tr>
												<td class="total_position">Delivery cost</td>
												<td class="basket_delivery">
													<span class="currency">$</span><span class="amount">325.67</span>
												</td>
											</tr>
											<tr>
												<td class="total_position">Discount (<span class="discount_percent">0</span>%)</td>
												<td class="basket_discount">
													-<span class="currency">$</span><span class="amount">325.67</span>
												</td>
											</tr>
											<tr class="total">
												<td class="total_position">
													<h3>Order Total</h3>
												</td>
												<td class="basket_total">
													<h3>
														<span class="currency">$</span><span class="amount">325.67</span>
													</h3>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
						</div>
					</div>
					<div class="navbar">
						<div class="navbar-inner">
							<ul class="nav custom_nav">
								<li class="pull-left">
									<div>
											<i class="icon-hand-left icon-white"></i>
											Continue Shopping
										</a>
									</div>
								</li>
								<li class="pull-right">
        <span class="btn btn-success continue_to_checkout" type="submit" value="Checkout" name="cont_to_checkout1">
            Continue To Checkout
        </span>
    </a>
</li>
								<li class="pull-right">&nbsp;&nbsp;</li>
								<li class="pull-right">
									<div>
										<button class="btn btn-danger remove_all" type="submit" name="remove_all2" value="remove_all" rel="tooltip" data-placement="top" data-original-title="Be careful! All products will be entirely removed from the basket!">
											<i class="icon-remove icon-white"></i>
											Remove All
										</button>
									</div>
								</li>
							</ul>
						</div>
					</div>
				</div>
			</form>

i am still learning how to post topics properly. thanks yall.

Hi PRINCETON, welcome to the forum.

If it was me, I’d consider simplifying that code. There sure are a lot of tags in the form!

Anyway, the form has the method POST. That means when the form is submitted there will be an HTTP POST header with “key” “value” pairs with the key names based on the input names in the form.

eg. prod2_color1=Platinum

If you have PHP, the HTTP POST header pairs will be put into the global '$_POST array.

Is there a reason you can’t use the existing input names, are you certain nothing depends on them being named as they are now?

well i’ve already got my db setup and the php script to correspond. the db is pretty straightforward and binding the php script to the db is working. the cart i’m looking for (via retooling) is to simply pass 4 values to the php. with regard to the options of color, we have no color nor size…the only options to be passed byway of direct user input is “temple” and
“quantity”. i wanted to access the database fields “description, temple, quantity and price” to get the data an fill the order. is there a simpler way to do what i’m trying to do? i’m going to attempt to take out some of the unnecessary code. i don’t know where to start but i’ll work it out. thank you. i just need a point in the right direction. any other suggestions, ideas or steers will be implemented. i’m willing to work. thanks.

@Mittineague: wow…i have been thinking about your proposition over and over and that may be the best way to go and seems the easiest. just keep the values the way they are originally, change the php to the new values then edit in mysql and i can check it. why didn’t i think of that. and here i was bangin’ my head about it.thanks. lol thanks for the suggestion. i’m on it. wow, again. dude, you sharp.

i tried it and it didn’t work. bummer. i tried to use the order form and then check phpmyadmin and saw nothing in the table. so the first thing i did was run my php script to see what type of response i’d get. i got this message:

“Connected to database
Array
(
)”.

(although i don’t know what is supposed to be in the array, errors perhaps? but it did take away the previous error message i was receiving regarding an integrity error and one of the values needed be set to null)
in any event, the good connection is there. next i made sure the correct string in the html code to access the php script was correct and it is. if i may here is the html:

Image"></a></span>Framing You <small>Only @ Eye Was Framed</small></h1>
				</div>
			</header>
			<form id="shoppingCart" method="POST" class="form-inline" name="basket_form" action="myconnection/prac0.php">
				<div class="content">
                    <div class="navbar">
                        <div class="navbar-inner">
                            <ul class="nav custom_nav">
                                <li class="pull-left">
                                    <div>
                                        <a href="http://exxxxd.co" class="btn btn-info">
                                            <i class="icon-hand-left icon-white"></i>
                                            Continue Shopping
                                        </a>
                                    </div>
                                </li>
                   <li class="pull-right">
    <a href="http://eyewasframed.co/checkout.html">
        <span class="btn btn-success continue_to_checkout" type="submit" value="Checkout" name="cont_to_checkout1">
            Continue To Checkout
        </span>
    </a>
</li>
                                <li class="pull-right">&nbsp;&nbsp;</li>
                                <li class="pull-right">
                                    <div>
                                        <button class="btn btn-danger remove_all" type="submit" name="remove_all1" value="remove_all" rel="tooltip" data-placement="bottom" data-original-title="Be careful! All products will be entirely removed from the basket!">
                                            <i class="icon-remove icon-white"></i>
                                            Remove All
                                        </button>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </div>
					<div class="basket_list clearfix">
						<div class="tables">
						  <table class="table table_header">
								<thead>
									<tr>
										<th colspan="2" class="description">
											Item Description
										</th>
										<th class="size">
											Temple
										</th>
										
								  <th class="quantity">
											Quantity
									  </th>
										<th class="price">
											Price
										</th>
										<th class="subtotal">
											Subtotal
                  </th>
										<th>&nbsp;
											
										</th>
									</tr>
								</thead>
							</table>
							<table class="table">
								<tbody>
									<tr class="warning">
										<td class="thumb" rowspan="2"><a href="javascript: void(0);" title="Link to product page"><img src="img/331.jpg" alt="" width="123" height="91" title="Product Image"></a></td>
										<td class="description" rowspan="2">
											<a class="item-name" href="javascript: void(0);" title="http://exxxx.co/vantage_poxxxx.html">The Minimum</a>
											<div>
												<div class="item-availability"><em>These Diamond Shape Spectacles Accentuate Anyone's Style and Grace</em>.</div>
												<div class="item-sku">MDL331</div>
											</div>
										</td>
										<td class="size">
                                            <select class="span2" id="prod2_size1" name="prod2_size1">
												<option value="Buffalo Horn" selected>Buffalo Horn</option>
												<option value="Gold">Gold</option>
												<option value="Rose Gold">Rose Gold</option>
												<option value="White Gold">White Gold</option>
												<option value="Titanium">Titanium</option>
												<option value="Platinum">Platinum</option>
                                            </select> 
								    </td>
										<td class="color">


											<input type="hidden" id="prod2_color1" name="prod2_color1" value="no">
										</td>
								  <td class="quantity">Qty:								    <input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini">
							      </td>
										<td class="price">
											<span class="currency">$</span><span class="amount">3000.00</span>
										</td>
										<td class="subtotal">
											<span class="currency">$</span><span class="amount">3000.00</span>
										</td>
										<td class="remove">
                                            <button class="btn btn-danger btn-mini" type="submit" name="prod2_remove1" value="remove_item" rel="tooltip" data-placement="left" data-original-title="Be careful! This item will be entirely removed from the basket!">
                                                <i class="icon-remove icon-white"></i>
                                            </button>
										</td>
									</tr>
									<tr class="warning additional_empty">
										<td class="empty_td" colspan="8">
											
										</td>
									</tr>
							  </tbody>
					    </table>
                        
                        
                        <table class="table">
							  <tbody>
									<tr class="warning">
										<td class="thumb" rowspan="2">
									  <a href="javascript: void(0);" title="http://eyexxxxint.html"><img src="img/332.JPG" width="123" height="91"></a></td>
										<td rowspan="2" class="description">
											<a class="item-name" href="javascript: void(0);" title="Link to product page">The Medium</a>
											<div>
												<div class="item-availability">
												  <p><em>Timeless Design, </em><em>A true work of art</em>, <em>High Quality Lenses, </em><em>A Comfortable Fit</em></p>
</div>
												<div class="item-sku">MDL332</div>
											</div>
										</td>
										<td class="size">
                                          <select class="span2" id="prod2_size1" name="prod2_size1">
												<option value="Buffalo Horn" selected>Buffalo Horn</option>
												<option value="Gold">Gold</option>
												<option value="Rose Gold">Rose Gold</option>
												<option value="White Gold">White Gold</option>
												<option value="Titanium">Titanium</option>
												<option value="Platinum">Platinum</option>
                                            </select>
										</td>
										<td class="color"><input type="hidden" id="prod2_color1" name="prod2_color1" value="no">
									  </td>
								  <td class="quantity">Qty:								    <input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini">
							      </td>
										<td class="price">
											<span class="currency">$</span><span class="amount">4000.00</span>
										</td>
										<td class="subtotal">
											<span class="currency">$</span><span class="amount">4000.00</span>
										</td>
										<td class="remove">
                                            <button class="btn btn-danger btn-mini" type="submit" name="prod2_remove1" value="remove_item" rel="tooltip" data-placement="left" data-original-title="Be careful! This item will be entirely removed from the basket!">
                                                <i class="icon-remove icon-white"></i>
                                            </button>
										</td>
									</tr>
									<tr class="warning additional_empty">
										<td class="empty_td" colspan="8">
											
									  </td>
									</tr>
							  </tbody>
					    </table>
                        
                        
                        <table class="table">
						  <tbody>
									<tr class="warning">
										<td class="thumb" rowspan="2">
											<a href="javascript: void(0);" title="Link to product page">
												<img src="img/333.jpg" width="123" height="91" title="Product Image">
											</a>
    </td>
										<td class="description" rowspan="2">
											<a class="item-name" href="javascript: void(0);" title="Link to product page">The Maximum</a>
											<div>
												<div class="item-availability"><em>Rimless frames</em>, <em> Sophistication &amp;  Elegance</em> by Design</div>
												<div class="item-sku">MDL333</div>
											</div>
										</td>
										<td class="size">
                                            <select class="span2" id="prod2_size1" name="prod2_size1">
												<option value="Buffalo Horn" selected>Buffalo Horn</option>
												<option value="Gold">Gold</option>
												<option value="Rose Gold">Rose Gold</option>
												<option value="White Gold">White Gold</option>
												<option value="Titanium">Titanium</option>
												<option value="Platinum">Platinum</option>
												
                                            </select>
										</td>
										<td class="color"><input type="hidden" id="prod2_color1" name="prod2_color1" value="no">
									  </td>
										<td class="quantity"><label class="inline">Qty:</label><input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini">
										</td>
										<td class="price">
											<span class="currency">$</span><span class="amount">5000.00</span>
										</td>
										<td class="subtotal">
											<span class="currency">$</span><span class="amount">5000.00</span>
										</td>
										<td class="remove">
                                            <button class="btn btn-danger btn-mini" type="submit" name="prod2_remove1" value="remove_item" rel="tooltip" data-placement="left" data-original-title="Be careful! This item will be entirely removed from the basket!">
                                                <i class="icon-remove icon-white"></i>
                                            </button>
										</td>
									</tr>
									<tr class="warning additional_empty">
										<td class="empty_td" colspan="8">
											
									  </td>
									</tr>
							  </tbody>
					    </table>
                                                
						</div>
						<div class="empty_basket">
							Your Shopping Cart is empty!
						</div>
						<div class="order_blocks clearfix">
							<div class="row">
								<div class="span6 shipping_block clearfix">
									<div class="delivery_block pull-left">
										<h4>Delivery Method</h4>
										<label class="radio">
											<input type="radio" name="deliveryOption" id="deliveryOption1" value="0" checked>
											STANDARD - 4-5 working days: <span class="currency">$</span>0.00
										</label>
										<label class="radio">
											<input type="radio" name="deliveryOption" id="deliveryOption2" value="9.95">
											EXPRESS DELIVERY - 48h: <span class="currency">$</span>9.95
										</label>
									</div>
								</div>
								<div class="span6 total_block">
									<h4>Summary Block</h4>
									<table id="basketTotalsList">
										<tbody>
											<tr>
												<td class="total_position">Goods Subtotal</td>
												<td class="basket_subtotal">
													<span class="currency">$</span><span class="amount">325.67</span>
												</td>
											</tr>
											<tr>
												<td class="total_position">Taxes (<span class="taxes_percent">0</span>%)</td>
												<td class="basket_taxes">
													<span class="currency">$</span><span class="amount">325.67</span>
												</td>
											</tr>
											<tr>
												<td class="total_position">Delivery cost</td>
												<td class="basket_delivery">
													<span class="currency">$</span><span class="amount">325.67</span>
												</td>
											</tr>
											<tr>
												<td class="total_position">Discount (<span class="discount_percent">0</span>%)</td>
												<td class="basket_discount">
													-<span class="currency">$</span><span class="amount">325.67</span>
												</td>
											</tr>
											<tr class="total">
												<td class="total_position">
													<h3>Order Total</h3>
												</td>
												<td class="basket_total">
													<h3>
														<span class="currency">$</span><span class="amount">325.67</span>
													</h3>
												</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
						</div>
					</div>
					<div class="navbar">
						<div class="navbar-inner">
							<ul class="nav custom_nav">
								<li class="pull-left">
									<div>
										<a href="http://exxxxd.co" class="btn btn-info">
											<i class="icon-hand-left icon-white"></i>
											Continue Shopping
										</a>
									</div>
								</li>
								<li class="pull-right">
    <a href="http://eyewasframed.co/checkout.html">
        <span class="btn btn-success continue_to_checkout" type="submit" value="Checkout" name="cont_to_checkout1">
            Continue To Checkout
        </span>
    </a>
</li>
								<li class="pull-right">&nbsp;&nbsp;</li>
								<li class="pull-right">
									<div>
										<button class="btn btn-danger remove_all" type="submit" name="remove_all2" value="remove_all" rel="tooltip" data-placement="top" data-original-title="Be careful! All products will be entirely removed from the basket!">
											<i class="icon-remove icon-white"></i>
											Remove All
										</button>
									</div>
								</li>
							</ul>
						</div>
					</div>
				</div>
			</form>

and the php:

    try {
    $dbh = new PDO("mysql:host=$hostname;dbname=new_order", $username, $password);
    

$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_SILENT );
$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING );
$dbh->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
/*** echo a message saying we have connected ***/
echo 'Connected to database<br />';


?>

<body>


<?php


if ($_SERVER["REQUEST_METHOD"] == "POST")

{
$errors = [];
}

if(empty($errors)) {
    
    echo "<pre>";
print_r($_POST);
echo "</pre>";
exit;


// prepare sql and bind parameters
    $query = "INSERT INTO details (description, prod2_size1, prod2_qty1, price)
            VALUES (:description, :prod2_size1, :prod2_qty1, :price)";
}
    $stmt = $dbh->prepare($query);
        $stmt->bindParam(':description', $_POST['description']);
        $stmt->bindParam(':prod2_size1', $_POST['prod2_size1']);
        $stmt->bindParam(':prod2_qty1', $_POST['prod2_qty1']);
        $stmt->bindParam(':price', $_POST['price']);
       $stmt->execute();


} catch (PDOException $exception) {
echo $exception->getMessage() . "<br />";
}

/*** close the database connection ***/
$dbh = null;

?>

just point me in the right direction. i’ll do my own work. thanks, yall.

Unless you patched together HTML from three or more pages for your example code, there are problems.
There can only be one of any “id”.
Having more than one can easily cause CSS and JavaScript problems, so the first step is to run the HTML through the validator and fix any errors (probably safe to ignore Warnings for now)

Also, I don’t now how browsers deal with text inputs that have the same name. My guess is they would use the last one over-riding the earlier ones, but having three of them in one form isn’t a good idea (radios, yes, text inputs, no) eg.

<input type="hidden" id="prod2_color1" name="prod2_color1" value="no">
<input type="hidden" id="prod2_color1" name="prod2_color1" value="no">
<input type="hidden" id="prod2_color1" name="prod2_color1" value="no">

Qty:	<input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini">
Qty:	<input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini">
<label class="inline">Qty:</label><input id="prod2_qty1" name="prod2_qty1" type="text" class="number" value="1" class="inline input-mini">

Same with the 3 selects

<select class="span2" id="prod2_size1" name="prod2_size1">
<option value="Buffalo Horn" selected>Buffalo Horn</option>
<option value="Gold">Gold</option>
<option value="Rose Gold">Rose Gold</option>
<option value="White Gold">White Gold</option>
<option value="Titanium">Titanium</option>
<option value="Platinum">Platinum</option>
</select>

<select class="span2" id="prod2_size1" name="prod2_size1">
<option value="Buffalo Horn" selected>Buffalo Horn</option>
<option value="Gold">Gold</option>
<option value="Rose Gold">Rose Gold</option>
<option value="White Gold">White Gold</option>
<option value="Titanium">Titanium</option>
<option value="Platinum">Platinum</option>
</select>

<select class="span2" id="prod2_size1" name="prod2_size1">
<option value="Buffalo Horn" selected>Buffalo Horn</option>
<option value="Gold">Gold</option>
<option value="Rose Gold">Rose Gold</option>
<option value="White Gold">White Gold</option>
<option value="Titanium">Titanium</option>
<option value="Platinum">Platinum</option>
</select>

The $_POST array should have

$_POST['prod2_color1']
$_POST['prod2_qty1']
$_POST['deliveryOption']
$_POST['prod2_size1']

But there are problems with the PHP code

The conditional that checks if the form was submitted only defines the $errors array. Most like the closing curly brace should be moved to after the rest of the PHP code that does stuff when the form was submitted. As it is now, the print_r will show an empty POST array when the form hasn’t been submitted.

Also, unless you left it out of the example code, the “catch” needs to be after a “try”

With PHP only the last one gets passed. If you want to pass all of them you need to add to the end of the name so that they get treated as an array.

1 Like

i don’t know if this has any bearing on the case but the form is basically a process of elimination. the user chooses only one of the items available. to do so the user must cancel out every other option available before the hit the submit button. kinda like a process of elimination. after the item is chosen (via the process of elimination) i want that information left to go to the php script for processing. there are no text inputs in this form…only drop down menu choices and kill any other options but the one the user wants and the reamining data passed on for processing via php.
here is the url: http://

the first thing the user must do is eliminate any other option by clicking the red “X”. most users will only choose one (because of the price of the items). if the user wants more than one of items they may contact us.i will build a script explaining that later…where quantity is more than one a tool tip will appear reading contact us. this eye ware is xclusive so anyone wanting to purchase more than one need contact us so we don’t waste resources
there will be no promo code and i intend on validating or sanitzing the dropdowns.
any thoughts much welcome.

Ummm. they are the ones like <input .... type="text"

Yes, all user supplied input should be tested. But for now, I was talking about validating the HTML code using
http://validator.w3.org/ as a first step to troubleshooting to find and fix any problems that might be responsible for.

type=“hidden” fields are effectively text inputs as well but ones where the field isn’t displayed.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.