The issue on the news page (half way through the content) is that it didn't like the first line of the second snippet of code below. So I tried to encase it with headers_sent...
Code: Select all
if (!headers_sent()) {
//class settings {//stuff here}
}I'd like to not have to create two PHP class files because it's obvious it would be a total pain to maintain two files when I added more classes though I'm not sure what I can do in this situation?
* EDIT *
I should note that the PHP class is not working for some reason.
Here is a quick run down of what my class file looks like with the audio class...
Code: Select all
class settings {//stuff here}
if ($_GET['audio'] == "0") {$trueaudio = 0; if (!headers_sent()) {setcookie('audio','0',time()+2592000,'/');}}
else if ($_GET['audio'] == "1") {$trueaudio = 1; if (!headers_sent()) {setcookie('audio','1',time()+2592000,'/');}}
else if ($_GET['audio'] == "2") {$trueaudio = 2; if (!headers_sent()) {setcookie('audio','2',time()+2592000,'/');}}
else if ($_COOKIE['audio'] == "0") {$trueaudio = 0;}
else if ($_COOKIE['audio'] == "1") {$trueaudio = 1;}
else if ($_COOKIE['audio'] == "2") {$trueaudio = 2;}
else {$trueaudio = 0;}
$settings = new settings();
$settings->set('audio',$trueaudio);