Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Edit css from within website, like wordpress editor

Featured Replies

Hi guys,

 

Just had a request from a client.

They have 2 sites, one uses wordpress, the other uses an ecommerce system.

 

They want to be able to make small css and file changes through the admin panel of the ecommerce system the same way they do with wordpress.

 

Does anybody know how this could be acheived? They already have ftp but would prefer to be part of the system itself.

 

Ecommerce system is in php. I can give them read/write access to the files.

 

Cheers

Hi, this may get you started.

<?php
$test = "test.css";
$fh = fopen($test, 'r');
$newcss = fgets($fh);
fclose($fh);
?>

 

that opens the file

put $newcss inside an editor

<textarea><?php echo $newcss; ?></textarea>

so they can edit the css file

When they submit call the below php that will overwrite the css file

<?php
$test = "test.css";
$fh = fopen($test, 'w') or die("can't open file");
$css = "$newcss";
fwrite($fh, $css);
fclose($fh);
?>

 

not tested but not far off

Edited by ELITE

  • Author

Bluedreamer : no it doesn't unfortunately.

 

Elit: cheers for that, will give it a bash in a bit. :)

or you can use file_get_contents and file_put_contents

yes i never thought of that

Edited by ELITE

  • Author

cheers webdesigner93, file_get_contents and file_put_contents did the trick, just had to change some file permissions.

 

:)

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.