title: updating database using jsp
body: <p>i am creating a website with a database attached using netbeans, and MySQL.
  I have written a piece of code for information submitted in a form on the website to be entered into the database, however the actual input is not inserted into the database, only '$_POST[username]','$_POST[date]','$_POST[message1]','$_POST[acknowledgment]'... i want these values to be the values the user inputs. </p>
  
  <p>can anyone help me to fix this or suggest anything please</p>
  
  <pre><code>&lt;%@taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql"%&gt;
  &lt;%-- 
      Document   : teacher1
      Created on : 07-Mar-2012, 02:36:31
      Author     : 
  --%&gt;&lt;sql:update var="messages" dataSource="jdbc/noticeboard"&gt;
      INSERT INTO messages (username, postedon, message, acknowledgment)
  VALUES ('$_POST[username]','$_POST[date]','$_POST[message1]','$_POST[acknowledgment]')
  &lt;/sql:update&gt;
  
  
  
  &lt;%@page contentType="text/html" pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
          &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
          &lt;title&gt;JSP Page&lt;/title&gt;
      &lt;/head&gt;    &lt;body&gt;
          &lt;h1&gt;Hello World!&lt;/h1&gt;
  
          &lt;h1&gt;Submit your notices below:&lt;/h1&gt;
  
          &lt;form name="messages" action="teacher1messages.jsp" method="POST"     enctype="multipart/form-data"&gt;
          &lt;h1&gt;Username:&lt;/h1&gt;
          &lt;input type="text" name="username" value="eg.cs09kkk1" /&gt;
              &lt;h1&gt;Date of notice:&lt;/h1&gt;
              &lt;input type="text" name="date" value="dd/mm/yy" /&gt;
              &lt;h1&gt;Notice:&lt;/h1&gt;
              &lt;textarea name="message1" rows="4" cols="20"&gt;
  [Type your notices here]
              &lt;/textarea&gt;
              &lt;input type="submit" value="submit" name="submit" /&gt;
              &lt;h1&gt;Acknowledgment:&lt;/h1&gt;
              &lt;input type="text" name="acknowledgment" value="" /&gt;
          &lt;/form&gt;
  
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>thank you!!!</p>