0

i have error on line 58 if(isset($_SESSION['username'])){ , when i tried on xampp localhost its work and no error but when i hosting to the 000webhosting, its have so many errors

Warning: session_start(): Cannot start session when headers already sent in /storage/ssd4/858/9397858/public_html/atasan.php on line 58 enter image description here

file php here:

Deleted link full of crap was here.

link hosting: https://ayojalankuy.000webhostapp.com/

    <?php session_start();

if(isset($_SESSION['username'])){
?>
            <span class="element-divider place-right"></span>
            <div class="element place-right">                   
                <a class="dropdown-toggle icon-cog" href="#"></a>
                <ul class="dropdown-menu" data-role="dropdown">
                    <li><a href="profil.php">Profil</a></li>
                    <li><a href="booking.php">Booking</a></li>
                    <li><a href="bookingList.php">Cek Booking</a></li>
                    <li class="divider"></li>
                    <li><a href="logout.php">Keluar</a></li>
                </ul>
            </div>
            <a href="profil.php" class="element place-right">Selamat datang, <?php echo "$_SESSION[username]"; ?></a>
Dharman
  • 30,962
  • 25
  • 85
  • 135
  • If you want to share some code then do it here, not on some site with 100 popups and stuff that blocks you from leaving the site. – Andreas May 08 '19 at 03:44

1 Answers1

0

Try putting session_start() at the top before any other code