I would like to know if someone has or gets me some script to change content of a PHP file in specific lines without changing the others, it can be fopen , fwrite strong> fclose .
I actually want, along with data captured in form
, to change some define
.
The input[name='url_site']
would change the line define('WFOX_SITE_URL', 'http://127.0.0.1/wfox');
The input[name='theme_site']
would change the line define('WFOX_SITE_THEME', WFOX_SITE_DIR . '/v1');
The input[name='name_site']
would change the line define('WFOX_SITE_NAME', 'Meu Projeto');
Full script [define_log.php]
:
error_reporting(0);
session_start();
$user_id = $_SESSION['user_id'];
date_default_timezone_set('America/Fortaleza');
ini_set('default_charset', 'utf-8');
define('WFOX_BASE_DIR', __DIR__);
define('WFOX_SITE_DIR', WFOX_BASE_DIR . '/wfox-content');
define('WFOX_ADMIN_DIR', WFOX_BASE_DIR . '/wfox-admin');
define('WFOX_SITE_URL', 'http://127.0.0.1/wfox');
define('WFOX_SITE_ADM', WFOX_SITE_URL . '/wfox-admin');
define('WFOX_SITE_THEME', WFOX_SITE_DIR . '/v1');
define('WFOX_SITE_NAME', 'Meu Projeto');
include( WFOX_ADMIN_DIR . '/database/conn.php');
include( WFOX_ADMIN_DIR . '/api/wfox_bd_api.php');
include( WFOX_ADMIN_DIR . '/api/wfox_bd_post.php');
include( WFOX_ADMIN_DIR . '/api/wfox_bd_user.php');
include( WFOX_ADMIN_DIR . '/api/wfox_bd_upload.php');
include( WFOX_ADMIN_DIR . '/api/wfox_stats_chart.php');