What is the easiest way to set the background color in PHP?
just insert the following line and use whatever color you like
echo "<body style='background-color:pink'>";
<?php header('Content-Type: text/css'); ?> some selector { background-color: <?php echo $my_colour_that_has_been_checked_to_be_a_safe_value; ?>; }
CSS. PHP.
CSS (.. "" = # 000000 "" = #ffffff) , , , - , PHP HTML , CSS .
, aa "" " ", , , , CSS.
, , , , PHP, , , , ( elseif , , ?
php . ( "Content-type: text/css" ) style.php( )
, . , CSS Jay David Dorward.
PHP, GD . , GD. http://www.php.net/manual/en/function.imagecolorallocate.php
:
<style type="text/css"> <?php include("bg-color.php") ?> </style>
bg-color.php - :
<?php //Don't forget to sanitize the input $colour = $_GET["colour"]; ?> body { background-color: #<?php echo $colour ?>; }
CSS , , CSS. , .
css, php id , .
Source: https://habr.com/ru/post/1758149/More articles:want to convert ColeDateTime to CTime - mfcAvira Antivirus Detects Listening Function as Backdoor Model - c ++How to make Linq on ITypedList? - c #__Gnu_cxx help :: hash_map - hashmapHow to use dotfuscator in our dll - c # -4.0Calling bash functions from a subprocess - bashMonitor global keyboard input on mac using python - pythonHow to make fun of a web service call in a WF workflow? - unit-testingto learn softkey shortcuts in a window - windowsHow to draw an airbrush on UIImageView? - iphoneAll Articles