I want to do a demo page to simulate the read of the temperature from a room. I want to do that read from a file.txt. In this file i write data manualy:
18 celsius or just 18
I want to show this data in my page. php row by row in 30 seconds. First 18, after 30 seconds 19, after 30 sec 20...
I have this script, but I have an error on line 3, sintax error: Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\licenta\mysql1.php on line 3.
Ok.I have the script..it is working.., but just the script. When I put the php code in a html page I get this error:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\licenta\zzz.php:10) in C:\xampp\htdocs\licenta\zzz.php on line 11
"Temperatura: 20" is the first line in my file.txt.
You know what is the problem..?
As soon as you start outputting (by writing <html> blah blah blah...) you've already sent the headers to the client. THEN, you're trying to call sesson_start which itself has to alter the headers, but wait, i've already sent the headers... DOH! Error...
In summary : put <?session_start();?> at the top of your script.