Jump to content

Recommended Posts

XHTML/CSS, the styling and coloring would have nothing to do with PHP unless you were simply outputting different CSS styles with php.  The entire thing that would control the style's is CSS.
in an external stylesheet, to the style you want to add a background color add
background-color:#CCCCCC;
or whatever other hex code for whatever other color you wanted, the background would change to that color.
Link to comment
https://forums.phpfreaks.com/topic/35037-change-website-colors/#findComment-165254
Share on other sites

No it would be
<link rel="stylesheet" type='text/css" href="/path/to/css.css" />
/path/to/css.css = The relative url path to your css file.

It has nothing to do with CSS code UNLESS you are outputting the css with php dynamically for some reason (A user based cms, or something similar.
Link to comment
https://forums.phpfreaks.com/topic/35037-change-website-colors/#findComment-165260
Share on other sites

Okay, then I have another question..........

If I have a form, for instance, has this...

Background Color: (Type HEX code)

And then I click SUBMIT, what PHP code would I use in order to change the CSS background color to the HEX color I submitted in the form?
Link to comment
https://forums.phpfreaks.com/topic/35037-change-website-colors/#findComment-165265
Share on other sites

The easiest way to do this using PHP, if I understand your question correctly, is to set a field in your database, for example, bgcolor. then when the page loads do something like:

[code]<style bgcolor="$bgcolor">[/code]

If you have the variable 'modify-able' by the user, when the refresh the page the bgcolor will be set to whatever they selected. You might want to do some looking into PHP / Stylesheets. There are some good examples of 'php-enabled' stylesheets on the web.

[url=http://www.barelyfitz.com/projects/csscolor/]http://www.barelyfitz.com/projects/csscolor/[/url] is a good place to start :)

Scot
Link to comment
https://forums.phpfreaks.com/topic/35037-change-website-colors/#findComment-165266
Share on other sites

Well, maybe not

If you wanted to do it instantly, (low level), use javascript and cookies (sessions)

Or if you wanted them to really have long distance editing capabiliteis (They had there own pages, you wanted them having permanent control over), save the settings in a database, then let php fetch those settings based on there ip when they return
Link to comment
https://forums.phpfreaks.com/topic/35037-change-website-colors/#findComment-165272
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.