Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Add php code inside textbox for a value


MCousin76

Recommended Posts

Posted

I am trying to insert php code inside a textbox to generate a value. The bolded item below is what i'm trying to generate. When i load the code on the page the textbox appears with $product_info[minorder] in the textbox. does anyone have any suggestions on how i can get the generated number to appear?

 

PS.>>>> The code works when it is like this. But, i need to have it in the main code inside the $price_string.

 

echo "<input type= \"text\" size=\"5\" value=" . $product_info['minorder'] ." name=\"quantity\">";

 

==================

The code looks like this...

==================

 

$qty_string .= '</td></tr>';

$price_string .= '</td></tr><tr><td colspan="6"><br><span class="smallText">Enter Quantity:</span> <input type="text" size="5" value="$product_info[minorder]" name="quantity"></td></tr>';

Posted

$price_string .= '</td></tr><tr><td colspan="6"><br><span class="smallText">Enter Quantity:</span> <input type="text" size="5" value="' . $product_info[minorder] . '" name="quantity"></td></tr>';

 

I'm surprised that you would not have tried that when you already know it works for the "echo".

Posted
$price_string .= '</td></tr><tr><td colspan="6"><br><span class="smallText">Enter Quantity:</span> <input type="text" size="5" value="' . $product_info[minorder] . '" name="quantity"></td></tr>';

 

I'm surprised that you would not have tried that when you already know it works for the "echo".

 

Thank you - that worked perfect. I'm somewhat new to php, I'm learning as i go.

 

Thanks again for all of your help!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...