Send user input to elasticsearch

Hello everyone,

I have a web form and I want user input to be stored in Elasticsearch into an index. I do no know how to do that, I have a method written in php but is not working :frowning: . The elk stack version is 7.15.2
can you help me?

<!DOCTYPE html>
<html lang="en">
<head>
    <title>FORM</title>
<body>

<form action="/form/send/send.php" method="post" >

Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">


</form>

</body>
</html>
$curl = new Curl();
$curl->setHeader('Content-Type', 'application/json');
$response = $curl->post('username:password[ip]:9200/index/type', array(
  'name' => '$name'
  'email' => '$email'
  
));
$curl->close();
?>

Thank you,Alex

I'm not familiar with PHP. But why not using the Elasticsearch PHP Client? See Elasticsearch PHP Client [7.16] | Elastic

An example here: