You can use EventListener to listen when a key is pressed and keyCode to check what the key is, then XMLHttpRequest to send to php
As you have not said if you use jquery, follow the example in pure js:
var input_busca = document.querySelector('#searchinputid')//Seleciona a input
input_busca.addEventListener('keypress', function (e) {
var key = e.which || e.keyCode;
if (key === 13) { // 13 = verifica se a tecla é o enter, 13 = enter
alert("Valor local: " + input_busca.value)//Exibe o valor local
var xhr = new XMLHttpRequest();
xhr.open('GET', 'get.php?searchinputid=' + input_busca.value, true);// Informações para enviar ao php
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
xhr.onload = function () {
alert("Resposta servidor: " + this.responseText);//Resposta do servidor
};
xhr.send();
}
});
<input id="searchinputid" type="text" class="searchinput"
name="txtbuscan" placeholder=" Search..." autocomplete="off">
Get.php sample code
<?php
$variavel = $_GET['searchinputid'];
echo $variavel;