"Twilio", "Uid"=>"twilio_sms", "PWD"=>"4ljp4NtWl3W3CvLUXMAjF1ziieErvLTvfDN85vHideu7w5bDmMr7"); $conn = sqlsrv_connect($serverName, $connectionOptions); if($conn == false) die(print_r(sqlsrv_errors())); } catch(Exception $e) { echo("Error!"); exit; } $number = $_POST['From']; $body = $_POST['Body']; if($number!="" && $body!="") { try { $sql = "INSERT INTO SMSReceived (Phone, SMSText,IP) VALUES (?,?,?)"; $params = array($number, $body,$_SERVER['REMOTE_ADDR']); $stmt = sqlsrv_query( $conn, $sql, $params); if($stmt == FALSE) { die(print_r(sqlsrv_errors())); #die(FormatErrors( sqlsrv_errors())); } #echo "Product Key inserted is :"; #while($row = sqlsrv_fetch_array($insertReview, SQLSRV_FETCH_ASSOC)) #{ # echo($row['ProductID']); #} sqlsrv_free_stmt($stmt); sqlsrv_close($conn); } catch(Exception $e) { echo("Error!"); exit; } } $response = new Twiml; $response->message("Message Received. Thanks for Reply."); print $response; ?>