ESH/save_config.php
2024-10-23 18:28:06 +05:30

29 lines
923 B
PHP

<?php
include('includes/config/config.php');
include ('includes/functions.php');
include ('log_entry.php');
error_log ( "Start Printing Request Attributes" );
$requestStr="";
foreach ( $_REQUEST as $key => $value ) {
$requestStr.=$key . " : " . $value . "\n";
error_log ( $key . " : " . $value . "<br />\r\n" );
}
error_log ( "End Printing Request Attributes" );
save_log($requestStr,'Config','SAVE','save_config.php');
$config_id = $_POST['config_id'];
$key_name =$_POST['key_name'];
$value = $_POST['value'];
if(!empty($config_id)){
$query = "update config set key_name = '$key_name', value = '$value', modified_by = '".$_SESSION['user_id']."' where config_id =
'".$config_id."' ";
}
else {
$query = "insert into config(key_name,value,modified_by)
values ('$key_name','$value','".$_SESSION['user_id']."' ); ";
}
if (!$result = @mysqli_query($conn,$query)) {
exit(mysqli_error($conn));
}
?>