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.
Link to comment
Share on other sites

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..
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.