I'm learning PHP this semester and I'm both enjoying it and immediately lost a bit on my first real assignment. There are a few other similar questions but, because I'm new, I'm not able to extrapolate their answers to help with this.
I am getting the error in the title. The mission is to create POST code to handle all of the product description, price data, etc. I've added that code, but I'm getting the must be a string error on like 13 (under product description) but am unsure why.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<title>Product Discount Calculator</title>
<link rel="stylesheet" type="text/css" href="main.css" />
<h1>This page is under construction</h1>
<span><?php echo $product_description = $_POST('product_desc'); ?></span><br /> (THIS IS LINE 13)
<span><?php echo $list_price_formatted = $_POST('list_price'); ?></span><br />
<span><?php echo $discount_percent_formatted = $_POST('std_discount'); ?></span><br />
<span><?php echo $discount_formatted= $_POST('discount_amt'); ?></span><br />
<span><?php echo $discount_price_formatted = $_POST('final_price'); ?></span><br />
$_POST is not a function but an array. Functions are invoked with parameters between parentheses, arrays are queried with square brackets. Thus: