Jump to content

Archived

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

corillo181

[SOLVED] why dont this work?

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]

Share this post


Link to post
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..

Share this post


Link to post
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]

Share this post


Link to post
Share on other sites

×

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.