[Solved] How to rewrite below JSP code in PHP [closed]


This will not work for you, because linking to the login.jsp or logout.jsp inside a php code will be likely to fail. But below code is somewhat equivalent of your jsp code. There is also no mysql query as you’ve described in title.

<?php /*  session_start() should be somewhere here */ ?>
<table width="1200" height="112" border="0">
    <tr>
      <td width="251" height="96"><img src="https://stackoverflow.com/questions/43338209/images/head.png" width="251" height="88" alt="Logo" /></td>
      <td width="726" class="right">Customer Support - <a href="contact.jsp">Contact us</a> | <a href="main.jsp">Home</a> |
        <?php if(is_null($_SESSION["username"])): ?> 
        <a href="https://stackoverflow.com/questions/43338209/login.jsp">Login</a>
        <?php else: ?>
        <a href="logout.jsp">Logout</a>
        <?php endif; ?>
        </td>
    </tr>
  </table>

solved How to rewrite below JSP code in PHP [closed]