<?php
if(file_exists('../../../'.$_REQUEST['tenant'].'/config.php')){require_once('../../../'.$_REQUEST['tenant'].'/config.php');}
if(file_exists('/config.php')){require_once('/config.php');}
$formNumber=str_replace("F","",$_REQUEST['formNumber']);
$data=array();
foreach($_REQUEST as $name=>$val){
    $val = str_replace(["\r", "\n"], ["\\r", "\\n"], $val);
    $data[$name] = $val;}

$output=json_encode($data);
$sql=mysqli_query($GLOBALS['con'],"UPDATE `default_text` SET `data`='".$output."' WHERE `formNumber`='".$formNumber."'")or die(mysqli_error($GLOBALS['con']));
echo "success";