hidden input

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dbdvd7
Forum Newbie
Posts: 18
Joined: Fri Nov 17, 2006 2:33 pm

hidden input

Post by dbdvd7 »

I'm trying to get a form to pull a product name off of the screen of the product it is displaying. to then put through my post. I need it hidden and this is as far as I got, any suggestions? Im not sure exactly how to describe this so ask me for any clarification.

Code: Select all

<td rowspan="7"><form id="Cart" action="addcart.php" method="post" name="Cart">
						<div align="left">
							<table width="244" border="0" cellspacing="2" cellpadding="0" height="120">
								<tr>
									<td>
										<div align="center">
												Small<br>
											<input type="text" name="Small" size="6" tabindex="1"></div>
									</td>
									<td>
										<div align="center">
												Medium<br>
											<input type="text" name="Medium" size="6" tabindex="2"></div>
									</td>
								</tr>
								<tr>
									<td>
										<div align="center">
												Large<br>
											<input type="text" name="Large" size="6" tabindex="3"></div>
									</td>
									<td>
										<div align="center">
												X-Large<br>
											<input type="text" name="XLarge" size="6" tabindex="4"></div>
									</td>
								</tr>
									<tr><td><input type="hidden"name={product_name}></tr></td>								
									<tr>
									<td>
										<div align="center">
											<input type="reset" value="Clear" tabindex="6"></div>
									</td>
									<td>
										<div align="center">
											<input type="submit" name="Add" value="Add To Cart" tabindex="5"></div>
									</td>
								</tr>
							</table>
						</div>
					</form></td>
			</tr>
<tr><td width="10%" class="listkey">Category:</td>
				<td class="listvalue">{product_category}</td>
			</tr>
<tr><td width="10%" class="listkey">Item:</td>
				<td class="listvalue">{product_name}</td>
			</tr>
<tr><td class="listkey">Color:</td>
				<td class="listvalue">{product_color}</td>
			</tr>
<tr><td class="listkey">Size:</td>
				<td class="listvalue">{product_size}</td>
			</tr>
<tr><td class="listkey">Price:</td>
				<td class="listvalue">{f_product_price}</td>
			</tr>
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

Post by shiznatix »

Code: Select all

<input type="hidden" name="SOME_NAME" value="$phpvalue" />
dbdvd7
Forum Newbie
Posts: 18
Joined: Fri Nov 17, 2006 2:33 pm

Post by dbdvd7 »

tried that and still cant get it. The php value I want to insert is the {product_name} at the bottom of the script
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

looks like you're using a templating system:

try this:

Code: Select all

<input type="hidden" name="SOME_NAME" value="{some_variable}" />
dbdvd7
Forum Newbie
Posts: 18
Joined: Fri Nov 17, 2006 2:33 pm

Post by dbdvd7 »

yeah im a little new to this, that worked though, thanks
Post Reply