title: Form content as PostGre query parameter
body: <p>So, I'm pretty new to web. I'm always fiddling with HTML and SQL, but recently I started working on a project. This project is basically creating a database with all employees contact data (name, email, phone number, etc) and show it on web. Database is set, web page is connecting normally to DB (I can call PHP and send a query, results are shown perfectly). BUT I don't know how to use a <code>&lt;form&gt;</code> content (text written by user) as a Query Parameter. I want to send the parameter when Enter or the 'busca' button are pressed.<br>
  Here is the form </p>
  
  <pre><code>&lt;form id="searchbox" &gt;
      &lt;label for="sectname"&gt;
      &lt;/label&gt;
      &lt;input id="sectname" name="sectname" type="search"      placeholder="Busca" list="setor" class="searchbox"/&gt;
      &lt;div style="text-align:center"&gt;
          &lt;input id="submit" type="button" class="button" value="BUSCA"/&gt;
      &lt;/div&gt;
  &lt;/form&gt; 
  </code></pre>
  
  <p>And here is the PHP with query </p>
  
  <pre><code>$host        = "host=localhost";
  $port        = "port=5432";
  $dbname      = "dbname=Cards";
  $creds = "user=postgres password=12345678";
  
  $db = pg_connect( "$host $port $dbname $creds"  );
  if(!$db){
    echo nl2br ("Unable to open database\n");
  } 
  
  $sql =&lt;&lt;&lt;EOF
    SELECT * from Cards where nome='Diego Teste';
  EOF;
  
  $ret = pg_query($db, $sql);
  if(!$ret){
    echo pg_last_error($db);
    exit;
  } 
  while($row = pg_fetch_assoc($ret)){
     echo "&lt;div&gt;";
    echo "&lt;img src='".$row['pic']."'class='cardcontent2'/&gt;";
     echo "&lt;div class='carddata'&gt;";
    echo nl2br ("\nNome: ".$row['nome'] . "\n");
    echo nl2br ("Email: ".$row['email'] . "\n");
    echo nl2br ("Ramal: ".$row['ramal'] . "\n");
    echo nl2br ("Número: ".$row['numero'] . "\n");
    echo nl2br ("Setor: ".$row['setor'] . "\n\n");
    echo "&lt;/div&gt;";
    echo "&lt;/div&gt;";
  }
  
  pg_close($db);
  </code></pre>
  
  <p>I want 'nome="Diego Teste"' to be 'nome= %var%' and the %var% value should be text written by user. </p>