Jump to content

PHP CSS editing form


hardcoretsunami

Recommended Posts

Hi everyone, I'm oli.

 

I am currently studying a degree in Digital media technology and as part of a group assignment I have been asked to research the following. I will start by giving a little background info on our project.

 

We are creating a website that will be an online store. It is an "online shop in a box". This means we will create a Cascading style sheet, the html and php and all server/databse stuff.

 

The project is almost complete, however, one of our requirements was to make the website customisable for the purchaser (the person who owns the website).

 

We have now bee told we cannot give the source code to the customer as someone with little understanding could easily ruin the site.

 

Our proposal is to create a program that could edit CSS from the server side easily.

 

So, is it possible to create a PHP form that can be opened server side that will have various variables such as font colour, size, and other editable attributes of the CSS, in order for the CSS to be edited without actually having to type into the source code?

 

Any help is greatly appreciated, if you require the CSS to better understand just ask.

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/152303-php-css-editing-form/
Share on other sites

I'd recommend you do it something like this:

in your html of the page, add this line in the header:

<link href="/includes/css.inc.php" rel="stylesheet" type="text/css" />

and for the css.inc.php file:

<?php
/*
db connection stuff here
..
..
..
*/
$user = "some_user";
$sql = "SELECT `style` FROM `some_table` WHERE `page`= $user LIMIT 1;";
result = mysql_query($sql);
$row = mysql_fetch_assoc($reslut);
echo $row['style'];
?>

This is an example. This way, all the CSS will be stored in a database.

Link to comment
https://forums.phpfreaks.com/topic/152303-php-css-editing-form/#findComment-799841
Share on other sites

nope. this will grab the CSS from the database (in other words, they can post their CSS to your server, you store it, and they use it).  They can fully customize it without uploading a file (or you can have it import the content of a file to the db.....), and without the need to view the source of the site.

Link to comment
https://forums.phpfreaks.com/topic/152303-php-css-editing-form/#findComment-799850
Share on other sites

 

do you understand what jonsjava is trying to teach you , if not tell me i will explain in depth.

 

ps. just like to no , dont tell me that it your end year at uni,  and now because the teacher makes you design a store you will pass in php and mysql.

 

just read agin , it takes a whole group to do that lol.

Link to comment
https://forums.phpfreaks.com/topic/152303-php-css-editing-form/#findComment-799874
Share on other sites

Well I think I do, I know very little about PHP to be honest.

 

Say I was the owner of the site, and I wanted to change the CSS without having to do it manually, would this allow it, as in offer me a list of drop downs and variables i could change rather than typing into the .css.

 

That may help you to understand what it is im after.

Link to comment
https://forums.phpfreaks.com/topic/152303-php-css-editing-form/#findComment-799904
Share on other sites

In the admin section, you create a set of drop downs with colors,

 

(let the user no, what the color drop down is for,  Example background color.)

 

Each color will represent a variable from the database, and that variable is placed where the color needs to be changed in the page.

 

example

 

database style

 

style_id

user_id

background_color

table_color

hr_color

 

ect ect ect ect

 

each time the user press the button to change the color, it updates the database via there user id

Link to comment
https://forums.phpfreaks.com/topic/152303-php-css-editing-form/#findComment-799908
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.