$_POST['param']
is a string, you can not treat it like an array. That’s why only f
characters are inserted.
You have two options, prepare data as an array in javascript or parse the string to array on the PHP side.
Sample code for 2nd option:
$table = $wpdb->prefix.'newsletter';
// 'firstname=FIRSTNAME&lastname=LASTNAME&email=EMAIL%40DOMAIN.COM&type=TYPE'
$input = explode( '&', $_POST['param'] );
$param = array_reduce( $input, function( &$carry, $item ) {
$parts = explode('=', $item);
$carry[ $parts[0] ] = urldecode( $parts[1] );
return $carry;
},
array()
);