Ruby Sinatra抓住POST

I have a PHP file which receives a value in a POST request (it is just a test file) and insert it in MySQL. Here's the code:

require_once('config.inc.php');

$str_values = $_POST['Msg'];
$sender=$_POST['SENDER'];

$trans_log = mysqli_query($dbhandle,"INSERT INTO GPRSIN (SMSFR,SMSMSG) 
                                                 VALUES ('".$sender."','".$str_values."')");

if($trans_log == 0){
  //return ref no and status
  echo "Insert Failed";
} else {
  echo "1";
}

I want to convert it into Ruby or Sintra but I don't know how to get the POST values from the URL and insert it to MySQL.