title: How to pass form input value to php function
body: <p>I want to write a php page in which there is a html form. I want to send all input (number for example) of my form to a php function (instead of a javascript function; I make this to hide my javascript function code).  </p>
  
  <p>How can I send input value to php function?<br>
  Is it possible to call the php function through <code>onclick="function(param1, param2)"</code>?<br>
  I know that javascript is a client-side language while php is server-side.</p>
  
  <p>If it is possible, how can I write the return of the function in an input field?<br>
  I want to remain in my page.<br>
  Is it correct - <code>action="#"</code>?<br>
  My code is:</p>
  
  <pre><code>&lt;form action="#" method="get"&gt;
      Inserisci number1: 
      &lt;input type="text" name="val1" id="val1"&gt;&lt;/input&gt;
  
      &lt;?php echo "ciaoooo"; ?&gt;
  
      &lt;br&gt;&lt;/br&gt;
      Inserisci number2:
      &lt;input type="text" name="val2" id="val2"&gt;&lt;/input&gt;
  
      &lt;br&gt;&lt;/br&gt;
  
      &lt;input type="submit" value="send"&gt;&lt;/input&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Help me in the implementation of the simple php function and in the passage of values from input to function!
  Thanks!</p>