how to sanitizing $_POST with the correct way?

Question

I am trying to sanitize and validate and escape this code?

    $positions = $_POST['positions'];

    foreach ($positions as $key => $position) {
      $id = sanitize_text_field($position[0]);
      $one = sanitize_text_field($position[1]);
      $two = sanitize_text_field($position[2]);
      $three = sanitize_text_field($position[3]);
      $four = sanitize_text_field($position[4]);

      $result = $wpdb->update( $wpdb->prefix.'test_my_table',
      array('one'=>$one,'two'=>$two ,'three'=>$three, 'four' => $four),array( 'id' => $id ));
   }

also i am trying to sanitize this code but i don’t know how anyone can help?

header($_SERVER['SERVER_PROTOCOL'].' 200 OK');
0
crazybuilding 3 weeks 2023-05-12T09:17:40-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse