Creating a login box in html
<p>hello all I am trying to make a login box on top of my html page, I am using php because if the user logged in then i ll display "Welcome, (his username)" else I would display username and password. Her is the code:</p>

<p><pre>
    &lt;?php
    session_start();</p>

<pre><code>if(!isset($_SESSION["$username"]))
{
     print "&amp;lt;div class=\"login\"&amp;gt;Welcome, $username &amp;lt;br/&amp;gt;&amp;lt;font Style=\"font-size:12px;\"&amp;gt;&amp;lt;a href=\"edit.php\"&amp;gt;Edit Account&amp;lt;/a&amp;gt; | &amp;lt;a href= \"log_out.php \"&amp;gt;Logout&amp;lt;/a&amp;gt;&amp;lt;/font&amp;gt;";
}

else
{

    print "div class=\"login\"&amp;gt;
    &amp;lt;form method=\"post\" action=\"login.php\"&amp;gt;
    Username:&amp;lt;input type=\"text\" size=\"30\" name=\"username\"/&amp;gt;&amp;lt;br/&amp;gt;
    Password:&amp;lt;input type=\"password\" size=\"30\" name=\"password\"/&amp;gt;&amp;lt;br/&amp;gt;
    &amp;lt;font Style=\"font-size:12px;\"&amp;gt;&amp;lt;a href=\"forgotpass.html\"&amp;gt; forgot  password? &amp;lt;/a&amp;gt; | &amp;lt;a href= \"register.html \"&amp;gt;Register&amp;lt;/a&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;br/&amp;gt;
    &amp;lt;input type=\"submit\" value=\"Login\" class=\"right\"/&amp;gt;
    &amp;lt;/form&amp;gt;";
 }

 ?&amp;gt;
</code></pre>

<p></pre></p>

<p>the output is kind of weird if you execute this on .php file like the login is suppose to be a button but it turns out to be a text and the else if getting printed. Can anyone tell me of any alternative?</p>
