| | |
User based look & feel customization of site
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Nov 2008
Posts: 5
Reputation:
Solved Threads: 0
Hi everybody,
I'm new in this forum, I'm a PHP developer looking for good solutions for changing colors, fonts, styles of a site on the fly. The idea is, the user will be given options to customize his/her web site's font, color of various elements etc. and then the site will be built accordingly. The look and feel will vary based on the user.
Can anyone give me a good solution how this can be done in a very efficient way.
Sayaan
I'm new in this forum, I'm a PHP developer looking for good solutions for changing colors, fonts, styles of a site on the fly. The idea is, the user will be given options to customize his/her web site's font, color of various elements etc. and then the site will be built accordingly. The look and feel will vary based on the user.
Can anyone give me a good solution how this can be done in a very efficient way.
Sayaan
•
•
Join Date: Jun 2008
Posts: 62
Reputation:
Solved Threads: 3
There are a lot of ways that you could do this. One way would be to use sessions to store some info.
You can use a form like this one...
Then place the following lines at the top of each php page....
Then in your <head> section echo your css theme....
You would have to echo the session color and font throughout your css file.
You could also have predefined styles and use a similar session result.
Please note: I haven't tested this, but I think it might work.
There are probably better ways of doing this, but hope it helps.
You can use a form like this one...
PHP Syntax (Toggle Plain Text)
<form id="theme" action="" method="post"> <p> <select name="Color"> <option>please select a Color ...</option> <option value="green">Green</option> <option value="blue">Blue</option> <option value="orange">Orange</option> <option value="purple">Purple</option> </select> <select name="Font"> <option>please select a Font ...</option> <option value="green">Green</option> <option value="blue">Blue</option> <option value="orange">Orange</option> <option value="purple">Purple</option> </select> <input type="submit" value="Change Theme"> </p> </form>
Then place the following lines at the top of each php page....
PHP Syntax (Toggle Plain Text)
<? session_start(); if(isset($_POST['Font'])) {$_SESSION['Font'] = $_POST['Font'];} if(isset($_POST['Color'])) {$_SESSION['Color'] = $_POST['Color'];} ?>
Then in your <head> section echo your css theme....
PHP Syntax (Toggle Plain Text)
<? echo "<style type 'text/css'>"; echo "p {color: ".$_SESSION['Color']." font-size: ".$_SESSION['Font']."}"; ?> echo "</style>";
You would have to echo the session color and font throughout your css file.
You could also have predefined styles and use a similar session result.
Please note: I haven't tested this, but I think it might work.
There are probably better ways of doing this, but hope it helps.
There are alot of people smarter than me, BUT at least I try to be of some help. Of coarse I'm not perfect, I need help too.
![]() |
Other Threads in the PHP Forum
- Previous Thread: File Upload Error
- Next Thread: Infinite loop problem need help plz
| Thread Tools | Search this Thread |
ajax apache api array beginner beneath binary broadband broken button cakephp checkbox class cms code countingeverycharactersfromastring crack cron curl database date decode display dynamic echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla limit link links login mail match md5 menu mlm multiple mysql mysql_real_escape_string oop paypal pdf php problem protocol query radio random recursion regex remote script search server session sessions sms smtp soap source space sql strip_tags survey syntax system table tutorial undefined update upload url validator variable video virus votedown web window.onbeforeunload=closeme; xml youtube





