irperera Posted September 27, 2006 Share Posted September 27, 2006 I'm creating a menu that uses css and mysql database. I have everything working, expect the fact that i need to go in manual and change or add css styles. what i would like to do is find out how to make php create a css file and input style where needed. can someone point me into the correct direction?irperera Quote Link to comment https://forums.phpfreaks.com/topic/22315-create-css-file-in-php/ Share on other sites More sharing options...
ToonMariner Posted September 28, 2006 Share Posted September 28, 2006 You could set the href of you css in the link tag to a php script which would output css.ORyou could use php to edit the css file. To do this you will need file_get_contents and file_put contents (or the fopen fread fput fclose equivalnet) and to develop a method of finding the relevant lines in the css.... Quote Link to comment https://forums.phpfreaks.com/topic/22315-create-css-file-in-php/#findComment-100011 Share on other sites More sharing options...
Ninjakreborn Posted September 28, 2006 Share Posted September 28, 2006 make a regular php file, and put it as<a href="style.php" rel="stylesheet" type="text/css" />it works perfectly if 1. you send a css header using php to the browser2. you make sure everything that outputs from the php is valid css, same for javascript files. Quote Link to comment https://forums.phpfreaks.com/topic/22315-create-css-file-in-php/#findComment-100537 Share on other sites More sharing options...
dustinnoe Posted October 13, 2006 Share Posted October 13, 2006 You could just embed the CSS and use php to echo the styles. Then you could pull from a database or SESSION. Quote Link to comment https://forums.phpfreaks.com/topic/22315-create-css-file-in-php/#findComment-108372 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.