Jump to content
Sign in to follow this  
gongpex

php put inside css file security

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

Share this post


Link to post
Share on other sites

More context please  

Share this post


Link to post
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
Sign in to follow this  

×