# Send user input to elasticsearch

**URL:** https://discuss.elastic.co/t/send-user-input-to-elasticsearch/290065
**Category:** Elasticsearch
**Created:** [November 24, 2021, 12:40pm UTC](https://discuss.elastic.co/t/send-user-input-to-elasticsearch/290065 "2021-11-24T12:40:36Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AlexM566](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexm566/32/89480_2.png) [@AlexM566](https://discuss.elastic.co/u/AlexM566)
#### Post date: [November 24, 2021, 12:40pm UTC](https://discuss.elastic.co/t/send-user-input-to-elasticsearch/290065/1 "2021-11-24T12:40:36Z")

</div>

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 ☹ . The elk stack version is 7.15.2  
can you help me?

```auto
<!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>

```

```auto
$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
```

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [November 24, 2021, 5:30pm UTC](https://discuss.elastic.co/t/send-user-input-to-elasticsearch/290065/2 "2021-11-24T17:30:30Z")

</div>

I'm not familiar with PHP. But why not using the Elasticsearch PHP Client? See [Elasticsearch PHP Client [7.16] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/index.html)

An example here:

> **[Indexing documents | Elasticsearch PHP Client \[7.16\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/client/php-api/current/indexing_documents.html)**

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 22, 2021, 5:30pm UTC](https://discuss.elastic.co/t/send-user-input-to-elasticsearch/290065/3 "2021-12-22T17:30:53Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
