I have created a System Management page to modify server paths and additional information. The purpose of this page is to modify this values as needed when transferring the pages to a different server. My question is, can I override the values after they have been initialized. I want the values to be override and stored like that from then on. If so, how can I do it? I am currently using input boxes, but the pages keep reading the original value instead of the new value.
Ex.
1st. root path = /var/www/html/wordpress/ (original)
2nd. root path = /var/www/html/sites/pages/ (new value)
This include: site name, root path, administrator email and more.
This variables are used on different pages by including the file. Ex.:
tools.php
<?php
// File containing System Variables
define("LOCAL_PATH_ROOT", $_SERVER["DOCUMENT_ROOT"]);
require LOCAL_PATH_ROOT . '/uas_tools/system_management/centralized_management.php';
<p>Please contact admin at
<a href="mailto:<?= $admin_email ?>?
to request access to this tool.</p>
?>
index.php (where input boxes are)
<div id="processing"></div>
<form action="centralized_management.php" method="POST">
<h2>System Management</h2>
<br>
<div>
<h4>Paths</h4>
<p>Root Path: <input name="root_path" type="text" value="/var/www/html/wordpress/" class="adjust"></p>
</div>
<br>
<div>
<h4>Configuration</h4>
<p>Number of threads to be used for mapping generation: <input name="cpu_number" type="number" value="32"
class="adjust"></p>
<p>Administrator Email: <input name="admin_email" type="email" value="[email protected]" class="adjust"></p>
</div>
<br>
<div style="text-align:center ; border:none">
<input name="submit" type="submit" value="Submit">
</div>
</form>
centralized_management.php (where values are stored)
<?php
// Paths
$root_path = "/var/www/html/wordpress/";
// Configuration
$cpu_number = "16";
$admin_email = "[email protected]";
if (isset($_POST['submit'])) { // the POST form has been submitted
// PATHS
// root_path
if (!empty($_POST['root_path'])) {
$root_path = ($_POST['root_path']);
}
// cpu_number
if (!empty($_POST['cpu_number'])) {
$cpu_number = ($_POST['cpu_number']);
}
// admin_email
if (!empty($_POST['admin_email'])) {
$admin_email = ($_POST['admin_email']);
}
}
?>
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…