How to specify variables in CSS via PHP?

There is a form, which specifies the color of the page. How to use PHP (I assume using POST method) to give them in the CSS on the page? I'm trying to withdraw, but something does not work. In style.php prescribed header c content-type.
Trying to display this:
body {
background-color: <?php echo $_POST['bg_color']; ?>;
}


What could be wrong?
June 14th 19 at 18:04
2 answers
June 14th 19 at 18:06
Solution
It is not so, it's some kind of perverted fierce.
For this purpose there is the JS you are trying to create a cross between Alien and Louis De Phineas.
Grab the Jquery library, go over the basics and You decide your own question.
I just need a job at uni) - noe_Breitenbe commented on June 14th 19 at 18:09
And definitely part of php ? - noe commented on June 14th 19 at 18:12
yeah - noe_Breitenbe commented on June 14th 19 at 18:15
You there in the University teachers do well?


<title>Islevli</title>
 <? include('style.php'); ?>


 <form action method="post">
 <input type="text" name="bgcolor">
 <input type="submit" value="Send">
</form>
 


//style.php
<style>
body {
 background:#<?= $_POST['bgcolor'];?>;
}
</style>
- noe commented on June 14th 19 at 18:18
Thank you! - noe_Breitenbe commented on June 14th 19 at 18:21
June 14th 19 at 18:08
Solution
and in a tribute style the body tag religion does not allow?

...

and the whole business. Leave css alone
Thank you! - noe_Breitenbe commented on June 14th 19 at 18:11

Find more questions by tags CSSPHP