Save the values in the configuration file. And make sure it is not accessible from the Internet.
The simplest solution is to store the values in the configuration array - the user enters the values, you generate an array from it, and then file_put_contents("config.php", "<?php $config = " . var_export($config)). With this method, whenever you need a config array, all you have to do is include config.phpand it is.
This is unverified code, for example, for purposes only. Depending on your situation, you may need to decide the conditions of the race, file_put_contentsthis is not enough. The bulk of the code above: var_exportreturns a valid php code that you can eval(if you're evil enough) or an echo to the file and include this later.
source
share