Hello. I get the errormessage: Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\json.php:1)
I know this errormessage will come, if I wrote something and want to send later an header information. But in this case I don't write anything. Here is my code starting at line 1.
<? header("Content-type: text/html; charset=utf-8");
require ("diplom/includes/php/datenbankfunktionen.php");
$sDB_Server = "localhost";
$sDB_User = "root";
$sDB_Password = "";
$sDB_Database = "JSON";
$sSql = "SELECT name, phone, mail as email, contactID AS id FROM contact;";
$aContacts = DB_GetSelectArray($sSql);
echo '{"DATA":'.json_encode($aContacts).',"SUCCESS":true,"ERRORS":[]}';
?>
Can somone help me? I use an developer system with XAMPP.