title: Update database data with submit button
body: <p>I want to update a database with new data so that when you put your text in a text-box and then click the submit button, the data will be sent to the database, with a specific id. All I want to send is brightness, with the code below. When I write something like this, and I run it, I receive a 403 error: Access forbidden. How can I fix this?</p>
  
  <pre><code>&lt;?php
     function updater($value,$id){
  // Create connection
     $conn = new mysqli( 'localhost' , 'user_name' , '' , 'data_base_name' );
  // Check connection
     if ($conn-&gt;connect_error) {
         die("Connection failed: " . $conn-&gt;connect_error);
     }
     $sql = "UPDATE table_name SET name=$value WHERE id=$id";
     if ($conn-&gt;query($sql) === TRUE) {
         echo "Record updated successfully";
     } else {
         echo "Error updating record: " . $conn-&gt;error;
     }
  //$conn-&gt;close();
  }
  ?&gt;
  
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;header&gt;
  &lt;/header&gt;
  &lt;body&gt;
      &lt;form action="&lt;?php updater($_POST['name'],1); ?&gt;" method="post" style="height:50px;width:50px;"&gt;
          &lt;input type="text" name="name" /&gt;&lt;br&gt;&lt;br&gt;
          &lt;input type="submit" /&gt;&lt;br/&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>