if ($this_version == $real_version){
$up_to_date = "Du har den siste versjonen! (".$real_version.")";}
else{
$up_to_date = "Du har ikke den siste versjonen! (".$real_version.")";
}
The "Headers Already sent" error occurs when output (including white space like a new line or a space) has already been sent to the browser and then you output something that uses a header. You can either find what is being output and eliminate it, or if you are deliberately outputting something, you can use output buffering to get around this problem - http://us3.php.net/manual/en/ref.outcontrol.php
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
I have posted another thread, but I did'nt seem to understand/find the solution.
I am trying to ouput a GD generated image, but it don't seem to work without posting the header information;
PHP Code:
header ("Content-type: image/gif");
First time for me working with GD, so interested in some complete tutorials if someone has it. But for a start, I apriciate any help concerning this problem!
if ($sd_this_version == $sd_real_version){
$up_to_date = "Du har den siste versjonen! (".$sd_real_version.")";}
else{
$up_to_date = "Du har ikke den siste versjonen! (".$sd_real_version.")";
}
This GD script, I found from a tutorial.
When inserting the code at the wanted spot in the code, it outputs the error-message; Headers Already sent.
I can't seem to find were the headers are already sent.. It says
Code:
Warning: Cannot modify header information - headers already sent by (output started at /******/startdoc.php:6) in /******/enddoc.php on line 17
But where it says the output has already been sent, there's only an echo;
PHP Code:
<? echo $sd_header; ?>
which points to a var inside the config.php;
PHP Code:
/*###################################
# Versjon Nummer #
###################################*/
$sd_this_version = "v2.0";
/*###################################
#####################################
# Ikke endre noe nedenfor #
#####################################
###################################*/
/*###################################
# Diverse Unike Site Variabler #
###################################*/
$sitename = "Aloebiz.net - ";
$sitename_clean = "Aloebiz.net";
$date_today = date("d/m/y H:i:s");
you better store the image you want to create in another file. you have to specify the header when creating an image, and there may be no data displayed before you specify the header. so this is wrong (example):
PHP Code:
echo "hello";
header("Content-type: image/gif");
// create the image
you just need to copy-past the code for the image into another page, and include that one. it should work then
Greetz,
UnrealEd
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks
I think I've got it. Here is what this needs. Place the following code into it's own .php file and remove it from where it is in the code now -
PHP Code:
<?
include("version.php");
echo "".$sd_sys."<br />";
echo "".$sd_copyright.", for ".$sitename_clean."<br />";
if ($sd_this_version == $sd_real_version){
$up_to_date = "Du har den siste versjonen! (".$sd_real_version.")";}
else{
$up_to_date = "Du har ikke den siste versjonen! (".$sd_real_version.")";
}
Where the above code was, put the following in as HTML (not as PHP) -
Code:
<img src="filename.php">
(where filename is what ever name you gave the first piece of code.)
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???