I want to click on a <li> and get the id to insert it into database via POST, is it possible?
<pre><code>&lt;form method="POST"&gt;
Something: &lt;input type="text" name="input" /&gt;
    &lt;ul&gt;
          &lt;li id="data1"&gt;Data 1&lt;/li&gt;
          &lt;li id="data1"&gt;Data 2&lt;/li&gt;
          &lt;li id="data1"&gt;Data 3&lt;/li&gt;
        &lt;/ul&gt;
    &lt;input type="submit" value="submit" name="submit" /&gt;
  &lt;/form&gt;
</code></pre>

<p>I would like to insert that data throught php if it was possible.<br/>
This is the code in php</p>

<p><code>if(isset($_POST['submit'])){</code><br/>
<code>$db=mysqli_connect("host", "user", "pass", "databasename");</code>
<code>$text=$_POST['input'];</code>
<code>$data=???????;</code>
<code>$insert=mysqli_query($db, "INSERT INTO tablename (text, data) VALUES ('".$text."', '".$data."'); }</code></p>

<p>-------UPDATE------<br/></p>

<pre><code>&lt;li id="data1"&gt;Data 1&lt;/li&gt;
&lt;li id="data2"&gt;Data 2&lt;/li&gt;
&lt;li id="data3"&gt;Data 3&lt;/li&gt;
</code></pre>