Page 1 of 1
PHP CODE HELP
Posted: Wed Nov 18, 2009 12:13 pm
by mystic
Hello All ,
I need codes in php wherein a user can customize the web page as per his requirements. Specifically , I have my website with a lot of colour ranges . I want that the user should be able to select the colour he wants and save it .
Thanks
Re: PHP CODE HELP
Posted: Wed Nov 18, 2009 12:33 pm
by superdezign
You want to make use of POST requests or JavaScript to set the user's selection, and make use of either a database or cookies to save the user's selection.
POST requests + database = PHP.
POST requests + cookies = PHP.
JavaScript selection + cookies = JavaScript.
JavaScript selection + database = AJAX.
Database is useful for saving the preferences of logged in users. Cookies are good for the current session, and can be effective for future sessions.
Posted: Wed Nov 18, 2009 1:28 pm
by Jonah Bron
Then, you can take those colors, and output them into a CSS file.
Please, remember to use useful subject titles.
Re: PHP CODE HELP
Posted: Mon Nov 23, 2009 7:44 am
by mystic
Thanks for your reply guys .I need the codes for the same : POST+DATABASE= PHP
THANKS !
Re: PHP CODE HELP
Posted: Mon Nov 23, 2009 7:48 am
by mystic
I have about 5 boxes on my webpage which offers colour customization for the user . I need php codes wherein the user can select the colour of his choice for each box and save it accordingly .
Example code :
<ul id="columnx" class="column">
<li id='boxes-rt' class="box color-red">
<div class="widget-head">
<h3>mystic</h3>
</div>
<div class="content">
<script>
Thanks
Posted: Mon Nov 23, 2009 1:24 pm
by Jonah Bron
Either have the user enter the hex RGB values (e.g. #F011AA) or create/use a javascript color picker that calculates it for them.
http://www.google.com/search?btnG=1&pws ... lor+picker
Re: PHP CODE HELP
Posted: Tue Nov 24, 2009 7:42 am
by mystic
Thanks for your reply Jonah . Can you suggest me some more ways seeing my code ..I have widgets with colours already defined on them ..The user just has to select and customize it ... . the ones you have listed dont seem to work for me ..
Thanks
Re: PHP CODE HELP
Posted: Tue Nov 24, 2009 7:54 am
by superdezign
Or instead of making the color selection JavaScript, just make it a link. Have that link set the user's preference and reload the page with the current styling. In order to do this, you need commonality between your scripts (like a common included script, or a global object) that looks for the color selection (which could be sent via the query string) and changes the display in accordance to the selection.
Re: PHP CODE HELP
Posted: Tue Nov 24, 2009 8:29 am
by mystic
How do I do that ? I have no idea ...Can you post the code for the same
Re: PHP CODE HELP
Posted: Tue Nov 24, 2009 8:34 am
by superdezign
Nope. Get started first, and then we'll help you.
Re: PHP CODE HELP
Posted: Tue Nov 24, 2009 8:52 am
by mystic
Well the link works for me ...I got my other pages working using links ...but this doesn't complete my requirement ...I have the widgets and I want users to customize those widgets ..How do I do that ..How can I save the user's customization ?
Re: PHP CODE HELP
Posted: Tue Nov 24, 2009 11:20 am
by superdezign
If you are using 3rd party widgets, I think that their documentation would be more helpful to you than general concepts, as you don't seem to be understanding them. o.O
Re: PHP CODE HELP
Posted: Tue Nov 24, 2009 3:28 pm
by mystic
I m not using 3 rd party widgets.... I just want to know how can a user when he logs on to my webpage can customize the webpage as per his preferences . To be very precise what I need . Example : In gmail we are able to select a theme as per our choice . Some webpages offer customization like select your own colours for widgets , own colour for back ground ...I nedd exactly this .. Please help .
It will be appreciated .
Thanks
Re: PHP CODE HELP
Posted: Wed Nov 25, 2009 1:57 pm
by superdezign
Are you doing pre-made themes that you define, or allowing users to define their own color schemes? If you are using pre-made themes, give them a simple selection of URLs that apply the theme and ask them to confirm their selection (or not... up to you). If you are allowing them to select their own colors, determine how you want to group your colors (i.e., text as one group, borders as another), and then give them a form to choose the colors. Upon submission, save those settings and generate their CSS dynamically.