Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change background color of a page using php

Tags:

php

I have a standard html page so:

<html>
<head>..
.
..
and so on

and i have a php script linked to that html page with:

if blablabla {

change background color;
}

does anyone know how to change the background color of my page if the conditions in the if statement are met?

I hope i made this clear, if not, please say which bit is unclear.

Thanks for any help in advance

like image 368
RSM Avatar asked Dec 09 '22 09:12

RSM


1 Answers

put your <body> tag inside the if else

if blablabla {

 echo '<body style="background-color:white">';
}
else {
 echo '<body style="background-color:orange">';
}
like image 53
Shakti Singh Avatar answered Dec 25 '22 20:12

Shakti Singh