Jump to content

[SOLVED] why dont this work?


corillo181

Recommended Posts

i thought this would let a user log in not to see this part of a table and a log out user is able to see it


[code]<? if(isset($_SESSION['username'])){ echo "ok";} else{ echo "<tr>
          <td background='BOTTLOM.jpg' class='menutxt'>Log in </td>
        </tr>
        <tr>
          <td id='loginSN'><?php include 'login.html' ?></td>
        </tr>";} ?>[/code]
Link to comment
Share on other sites

alright i found the problem ..

but got into a new one :-D

[code]<? if(isset($_SESSION['username'])){ echo "<tr><td background='images/BOTTLOM.jpg' class='menutxt'><a href=../phpscript/logout.php>LogOut</a></td></tr>";} else{ echo "<tr>
          <td background='images/BOTTLOM.jpg' class='menutxt'>Log in </td>
        </tr>
        <tr>
          <td id='loginSN'> <? echo include '/htmlforms/login.html' ?> </td>
        </tr>";} ?>[/code]

now the include file doesn't show..
Link to comment
Share on other sites

ok i found the problem again.. so now is there any shorty way of going on about this?


[code] <? if(isset($_SESSION['username'])){ echo "<tr><td background='BOTTLOM.jpg' class='menutxt'><a href=logout.php>LogOut</a></td></tr>";} else{ echo "<tr>
          <td background='BOTTLOM.jpg' class='menutxt'>Log in </td>
        </tr>
        <tr>
          <td id='loginSN'>"?> <? include 'login.html' ?><? "</td>
        </tr>";} ?>[/code]
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.