I’m having the same issue too. But I tried
$mydataproxy = $data;
$query_string .= $key . '=' . urlencode( stripslashes( $mydataproxy ) ) . '&';
it didn’t work. Do I have to change any variables above for it to work? I’m not sure if I did it correctly. All I did was pasting
$mydataproxy = $data
on top of
$query_string .= $key . '=' . urlencode( stripslashes( $mydataproxy ) ) . '&';