Jump to content

[SOLVED] Im trying to write a PHP script that says....


forumnz

Recommended Posts

"Login" if the user isnt logged in and "Logout" if they are.

This is my script so far but it doesnt seem to be working...

[code]<tr>
        <td width="5" height="29" bgcolor="#FFFFFF">&nbsp;</td>
       
<td width="751" background="images/bgblue.gif" bgcolor="#FFFFFF" class="login-view">
<div align="right" class="text style1">
<php?
if (!$_SESSION['username']){echo('Log In');?>
</div></td>


        <td width="4" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
      <tr>
        <td height="398" colspan="3" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="3" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>[/code]


Thanks.
Thanks,

How do I put this within the HTML code?... yes I have saved it as a PHP file, but its not working... heres a small sample of the newly edited code...

[code]<tr>
        <td width="5" height="29" bgcolor="#FFFFFF">&nbsp;</td>
       
<td width="751" background="images/bgblue.gif" bgcolor="#FFFFFF" class="login-view">
<div align="right" class="text style1">

<php?
if (!$_SESSION['username']){echo('Log In');} else {echo('Log Out');}?>
</div></td>


        <td width="4" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>[/code]

Thanks a lot..
Nope nothing at all... Im using dreamweaver for this php script and in the properties window it displays an error message saying that '<?php' should be <?> because its not correct HTML... but i am doin this in PHP... also... i uploaded it to a server to test it but nothing happened.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.