title: get value of submit in Text field when form is post in PHP
body: <p>I need the value of submit button when form is posted in existing text field. and below is the code.</p>
  
  <p>I trying out but it is creating a new text field.</p>
  
  <pre><code>&lt;?php
  $var1 = $_POST['hello'];
  //below here i am trying out something but not getting in exiting textfield.
  //i need the value of submit button ie some value in exiting textfield ie text1
  echo "&lt;input type='text' name='text1' value='$var1'&gt;";
  
  ?&gt;
  
  &lt;form method="post"&gt;
  &lt;input type="submit" name="hello" value="some value"&gt;
  &lt;input type="text" name="text1" value="dskfjls"&gt;
  &lt;/form&gt;
  </code></pre>