Jump to content

php put inside css file security


gongpex

Recommended Posts

Hello everyone,

It safe or not put php code on css file like this :

<?php
   header("Content-type: text/css; charset: UTF-8");
  
   $db = new mysqli("host", "username", "password", "database");
   if ($db->connect_error) {
		die("Connection failed: " . $db->connect_error);
   }
?>

/* css code */

Q : if not safe please tell me how to use php inside css.

Thanks

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...