DMP23
04-20-2006, 02:29 PM
having trouble outputting my form within an if statement. what i want to achieve is:
if the cookie is set to 1 - the user is loggin in , so great the user. if they are not logged in print the login form.
please advise
my curent code is:
<?php
if($_COOKIE['login']==1)
{
print "Hello ".$_COOKIE[firstname];
}
else
{
<FORM METHOD="POST" ACTION="frontpage3.php">
<strong>Username:</strong><br>
<INPUT TYPE="text" NAME="username">
<p><strong>Password:</strong><br>
<INPUT TYPE="password" NAME="password"><br>
<br><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login">
<p>
If you are not a registered user please register <a href="index_register2.html">here</a> </p>
</FORM>
}
?>
if the cookie is set to 1 - the user is loggin in , so great the user. if they are not logged in print the login form.
please advise
my curent code is:
<?php
if($_COOKIE['login']==1)
{
print "Hello ".$_COOKIE[firstname];
}
else
{
<FORM METHOD="POST" ACTION="frontpage3.php">
<strong>Username:</strong><br>
<INPUT TYPE="text" NAME="username">
<p><strong>Password:</strong><br>
<INPUT TYPE="password" NAME="password"><br>
<br><INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login">
<p>
If you are not a registered user please register <a href="index_register2.html">here</a> </p>
</FORM>
}
?>