How to supress the warning message in the php
<p>I am pretty new to php world. I wrote the following:</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;It joins simple1 and prac1 program together&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;?php
        if($_POST['user'])
        {
            print "hello,";
            print $_POST['user'];
        }
        else{
        print &lt;&lt;&lt;_HTML_
            &lt;form method="post" action="$_server[PHP_SELF]"&gt;
                Your name:&lt;input type="text" name="user"&gt;
                &lt;/br&gt;
                &lt;input type="submit" value="hello"&gt; 
            &lt;/form&gt;
        _HTML_;
        }           
    ?&gt;
&lt;/body&gt;
&lt;/html&gt;  ---- line 23
</code></pre>

<p>Getting Error message:</p>

<pre><code>Parse error: syntax error, unexpected $end in C:\wamp\www\php_practice\simple2.php on line 23
</code></pre>

<p>I have removed all html tags and just kept php tags it worked:</p>

<pre><code>&lt;?php
// Print a greeting if the form was submitted
if ($_POST['user']) {
print "Hello, ";
// Print what was submitted in the form parameter called 'user'
print $_POST['user'];
print "!";
} else {
// Otherwise, print the form
print &lt;&lt;&lt;_HTML_
&lt;form method="post" action="$_SERVER[PHP_SELF]"&gt;
Your Name: &lt;input type="text" name="user"&gt;
&lt;br/&gt;
&lt;input type="submit" value="Say Hello"&gt;
&lt;/form&gt;
_HTML_;
}
?&gt;
</code></pre>

<p>Output : Giving proper output but with an warning</p>

<pre><code>Notice: Undefined index: user in C:\wamp\www\php_practice\test.php on line 3
</code></pre>

<ol>
<li><p>Why it is not working with the previous case? What is going wrong? </p></li>
<li><p>How to remove or silent the warning message in the second code. It looks bad in the browser.</p></li>
</ol>
