I'm new at this language and I can´t understand this warning: Warning: Cannot modify header information - headers already sent by (output started at /Applications/AMPPS/www/.../users.php:316) in /Applications/AMPPS/www/.../phpgraphlib.php on line 213
I want to show some graphs about temperature, but appears the message above.
Here's my code:
phpgraphlib.php
protected function initialize()
{
//header must be sent before any html or blank space output
if (!$this->output_file) {
header("Content-type: image/png");
}
users.php
<!-- Temperature -->
<div class="" id="temperatura1" name="temp">
<?php require 'php/statics/staticsTemp.php';?>
<h3 class="centered">Temperature</h3>
<hr>
<br>
<table class="tg" border="10">
<tr>
<th class="tg-031e">Temperature ºC</th>
<th class="tg-031e">Date and Time</th>
</tr>
<?php foreach ($data as $datetime => $temperature): ?>
<tr>
<td class="tg-031e"><?php echo $temperature; ?></td>
<td class="tg-031e"><?php echo $datetime; ?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
Any thoughts to solve this?