Topic: login in main.tpl
I'm trying to add a small login box to the main page (in main.tpl). The thing is that I'd like it to only show up if the user isn't logged in. I've tried playing around with an if ($cookie['is_guest']) but to be honest I really don't know php all that well and since it's a tpl file - I can't get the code to execute. Here's what I did to main.tpl (the relevant section at least):
<table class="punmain" cellspacing="1" cellpadding="4">
<tr class="punhead">
<td class="punhead">
<span class="puntitle"><pun_title></span><br>
<pun_desc>
</td>
</tr>
<tr>
<td class="puncon1">
<table width="100%"><tr><td>
<pun_navlinks><br><br>
<pun_status>
</td>
echo '<td align="right">
<form method="post" action="login.php?action=in" id="login">
<input type="hidden" name="form_sent" value="1">
<input type="hidden" name="redirect_url" value="login.php">
Name: <input type="text" name="req_username" size="11" maxlength="25"><br>
Password: <input type="password" name="req_password" size="11" maxlength="16"><br>
</form></td>
</table>
</td>
</tr>
</table>
Any help would be appreciated, thanks!