how to form data to another file in php code example
Example 1: 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>
Example 2: how to form data to another file in php
name1=firstValue&name2=secondValue&name3=thirdValue
Example 3: how to form data to another file in php
$firstname = preg_replace( "#[^\w]#", "", $_POST['firstname'] );
$lastname = preg_replace( "#[^\w]#", "", $_POST['lastname'] );
Example 4: how to form data to another file in php
preg_replace( $pattern, $replacement, $subject, $limit, $count )
Example 5: how to form data to another file in php
<form action="demo/request-variable.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>
Example 6: how to form data to another file in php
}
Example 7: how to form data to another file in php
<form action="get-method.php" method="get"> <input type="text" name="firstname" placeholder="First Name" /> <input type="text" name="lastname" placeholder="Last Name" /> <input type="submit" name="submit" /> </form>
Example 8: how to form data to another file in php
echo '<h3>Form POST Method</h3>'; echo 'Your name is ' . $lastname . ' ' . $firstname; exit; }