Skip to content

Instantly share code, notes, and snippets.

@junaidtk
Created November 29, 2018 07:40
Show Gist options
  • Select an option

  • Save junaidtk/a9c06779944442542e2de7b7474e0ac8 to your computer and use it in GitHub Desktop.

Select an option

Save junaidtk/a9c06779944442542e2de7b7474e0ac8 to your computer and use it in GitHub Desktop.
Form Handling
if(isset($_POST['submit'])){
var_dump($_POST);
}
?>
<form method="post">
<input type="test" name="test">
<input type="test2" name="test2">
<div class="ttt" style="display: none;">
<input type="j1" name="j1" value="ttt">
<input type="j2" name="j2" value="yyy">
</div>
<input type="submit" name="submit">
</form>
if the form submission occure the input field inside the display none div will also submit the data.
if the form contain more than one input field with same name, the name comes in later of the page will submit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment