Beginner/Red PHP text in Dreamweaver

I am clearly a beginner. I was wondering if I could have another set of eyes to check out my php file.

[php]<?php
//get the data from the form
$product description = $_POST[‘product_description’];
$list_price = $_POST[‘list_price’];
$discount_percent = $_POST[.discount_percent’];

//calculate the discount and discounted price
$discount = $list_price * $discount_percent * .01;
$discount_-price = $list_price - $discount;

//apply currency formatting to the dollar and percent amounts
$list_price_formatted = "$".number_format($list_price, 2);
$discount_percent_formatted = $discount_percent."%";
$discount_formatted = "$".number_format($discount, 2);
$discount_price_formatted = "$".number_format($discount_price, 2);

?>

<title>Product Discount Calculation</title>
<link rel="stylesheet" type="text/css" href="styles.css" />
</head>

<body>
	<div id="content">
		<h1>Product Discount Calculation</h1>
		
		<label>Product Description:</label>
		<span><?php echo $product_description; ?></span><br>
		
		<label>List Price:</label>
		<span><?php echo $list_price_formatted; ?></span><br>
		
		<label>Standard Discount:</label>
		<span><?php echo $discount_percent_formatted; ?></span><br>
		
		<label>Discount Amount:</label>
		<span><?php echo $discount_formatted; ?></span><br>
		
		<label>Discount Price:</label>
		<span><?php echo $discount_price_formatted; ?></span><br>
		</div>
		</body>
		</html>[/php]

In dreamweaver my code is red like there is a problem. Just need a set of another eyes to check it out.

change $discount_percent = $_POST[.discount_percent’]; to $discount_percent = $POST[‘discount_percent’]; and $discount-price = $list_price - $discount; to $discount_price = $list_price - $discount;

Thank you very much. :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service