-1

I got the following warning:

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /customers/a/4/5/dalakh.se/httpd.www/RabbitResultHandler/competitions.php:1) in /customers/a/4/5/dalakh.se/httpd.www/RabbitResultHandler/competitions.php on line 1

I have googled a bit and as far as I understand the session_start() shall be on top of the page but I still got this problem and think I have tried al possible placings of session_start() but with no luck. Anyone that have any ides on what is the problem?

I attatch the code below:

<?php session_start(); ?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset = "UTF-8" />
        <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
        <link rel="stylesheet" type="text/css" href="style.css">
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    </head>
<body>
<?php
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
            echo 'I AM FREE!!!!!';
}

    require 'Functions/common_functions.php';
    printHeadWithLoginButton($_GET["club"]);
?>
<div style="float:right">
<h1>Tävlingar</h1>
<?php

$directory = "/customers/a/4/5/dalakh.se//httpd.www/RabbitResultHandler/Competitions/";

$images = glob($directory . "*.xml");
 echo "<table>";

foreach($images as $image)
{
    //echo $image . "<br />";
    //echo basename($image, ".xml") . "<br />";

    //echo "<a href=\"registration.php?competition=" . basename($image) . "\">" . basename($image, ".xml") . "</a> - ";
    echo "<tr>";
    echo "<td>";
    echo basename($image, ".xml");
    echo "</td>";
    echo '<td style="margin-left:auto;margin-right:auto;text-align: center;">';
    echo "<input type=\"button\" value=\"" . "Anmäl" . "\" onclick=\"location.href='registration.php?competition=" . basename($image, ".xml") . "';\">";
    echo "</td>";
    echo '<td style="margin-left:auto;margin-right:auto;text-align: center;">';
    echo "<input type=\"button\" value=\"" . "Översikt" . "\" onclick=\"location.href='overview.php?competition=" . basename($image, ".xml") . "';\">";
    echo "</td>";
    //echo "<br />";
    echo "</tr>";

}
echo "</table>";

echo "<input type=\"button\" value=\"" . "Arkiv över gamla tävlingar" . "\" onclick=\"location.href='competitions_archive.php';\">";

?>
<p>Har du problem eller undrar du hur man använder vårt anmälningsformulär? Kolla i första hand vår FAQ och skulle inte den vara tillräcklig eller om du bara vill delge dina synpunkter nås vi via vårt kontakformulär.</p>  
<?php
echo "<input type=\"button\" value=\"" . "FAQ" . "\" onclick=\"location.href='faq.php';\">";
?>
<input type="button" value="Kontakta oss" onclick="location.href='contact.php'" />
</div>
</body>
</html>
aksu
  • 5,221
  • 5
  • 24
  • 39
user1454695
  • 67
  • 1
  • 5

1 Answers1

1

Your file is encoded as UTF-8 and therefore has a Byte-Order Mark right at the beginning.

Try changing your file's encoding, either to a single-byte character set, or "UTF-8 without BOM" (which is an option in some editors, like Notepad++)

Niet the Dark Absol
  • 320,036
  • 81
  • 464
  • 592