<?php
global $wpdb;
if(isset($_POST["d1"])){
  require_once('../../../../wp-config.php'); 

    for($x=1; $x<=3; $x++){
        $option_name = 'setting_qgx'.$x;
        $nod = "d".$x;
        $new_value = $_POST[$nod];
        
        if ( get_option($option_name) !== false ) {
             update_option( $option_name, $new_value );
        }  else  {
            add_option( $option_name, $new_value, '', 'yes' );
        }

    }

}
?>