Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

For our intranet, I have a php settings file (which I have appropriately named config.inc.php) and values from here are passed to various areas of the site (such as internet status etc). When we want to change the status, we modify the text in this settings file and this works well.

 

For instance:

$status[0] = "Internet down";
$status[1] = "Email ok";
$status[2] = "Network ok";
?>

 

For the intranet index.php and other pages, I include this config file at the top then just have $status[x] echoed at the appropriate location.

 

However, I was wondering if it is possible to be able to add an "edit" button next to the text (this would only be visible and editable by admins) and to be able to edit these values via the web interface?

 

I have no problem doing the actual button and only allowing admin access to it, but what kind of php code is needed so that you can have a text box and submit button which will write back the values to the respective entries in the text file?

 

Ideally, an edit button would be next to the status text on the intranet, clicking this turns it into a text box (or similar) where you can amend the text, then a save/submit button passes this back to the config.inc.php file and saves that.

 

We're not fixing something that is broken, rather if possible making it easier to edit the text on the fly!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...