find the type of html input php code example

Example 1: php post variables to another page with submit button php

<html>
<form id="form" action="webAddressYouWantToRedirectTo.php" method="POST">
<input type="hidden" name="expectedPOSTVarNameOnTheOtherPage" value="<?php echo $varYouMadePreviouslyInProcessing ?>">
</form>
<script>
document.getElementById("form").submit();
</script>
</html>

Example 2: how to form data to another file in php

<form action="post-method.php" method="post">

<input type="text" name="firstname" placeholder="First Name" />

<input type="text" name="lastname" placeholder="Last Name" />

<input type="submit" name="submit" />
</form>