I m learning PHP , and I m posting variable from a HTML form
Below is my code:
<html>
<head>
<title>Welcome to PHP Products</title>
</head>
<body>
<?php
$txt1=$_POST["product_form_no"];
$txt2=$_POST["product_form_name"];
$txt3=$_POST["product_form_desc"];
<h1>The Entered Product</h1>
<p>Product No</p>echo $txt1;
<p>Product Name</p>echo $txt2;
<p>Product Desc</p>echo $txt3;
?>
</body>
</html>
I m getting the below error
Parse error: syntax error, unexpected ‘<‘ in C:\wamp\www\product_entered_list.php on line 12
Any help would be helpful !!!
Without that closing
?>, you’re still in “PHP mode” when the<h1> is reached, and PHP tries to interpret that as PHP code, not HTML.This means you’ll also have to modify your echo lines: