Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8995363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:36:36+00:00 2026-06-15T23:36:36+00:00

I m learning PHP , and I m posting variable from a HTML form

  • 0

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 !!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:36:37+00:00Added an answer on June 15, 2026 at 11:36 pm
    <?php
    $txt1=$_POST["product_form_no"];
    $txt2=$_POST["product_form_name"];
    $txt3=$_POST["product_form_desc"];
    
    ?>   <---missing
    

    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:

    <p>Product No</p><?php echo $txt1; ?>
                     ^^^^^^           ^^^
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning PHP. The PHP has inline commands in HTML code to produce dynamic
I am learning PHP PEAR and testing the following code. However when I login,
I'm learning php through head first's php and mysql and I'm toying with the
Possible Duplicate: PHP: Notice: Undefined variable and Notice: Undefined index I am just learning
I'm currently learning PHP and MySQL and I have been working from a basic
Hi I have been learning php from this book PHP Solutions Dynamic Web Design
New to learning PHP form validation on same page. Please advise as to why
I'm slowly learning PHP, MySQL, along with some HTML, using localhost as my webserver.
I took this code from Facebook's documentation to get me started in learning how
Just learning php and looking into someone else's code. I'm not sure what is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.