Welcome Guest, Not a member yet? Register   Sign In
own CONSTANT?
#7

[eluser]CroNiX[/eluser]
If you don't want to or can't use a database, you could always manually include() a "temp_constant.php" file at the bottom of /application/config/constants.php. Then in the admin, have a field where the admin can change the value. If the value changes, recreate the define() in the temp_constant.php file. The temp_constant.php file would just be:
Code:
<?php
//important so people can't directly access the variable!
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
define('NAME_OF_CONSTANT', value);
which should be fairly simple to create and write the file with php.

Code:
file_put_contents(path_to_temp_constant.php, $string_containing_the_above_code);


Messages In This Thread
own CONSTANT? - by El Forum - 03-22-2012, 07:22 AM
own CONSTANT? - by El Forum - 03-22-2012, 07:46 AM
own CONSTANT? - by El Forum - 03-22-2012, 07:50 AM
own CONSTANT? - by El Forum - 03-22-2012, 07:56 AM
own CONSTANT? - by El Forum - 03-22-2012, 08:07 AM
own CONSTANT? - by El Forum - 03-22-2012, 08:36 AM
own CONSTANT? - by El Forum - 03-22-2012, 02:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB