post request to php form code example
Example 1: php post
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
Name: <input type="text" name="fname">
<input type="submit">
</form>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
// do logic
$name = $_POST['fname'];
}
?>
Example 2: how to form data to another file in php
preg_replace( $pattern, $replacement, $subject, $limit, $count )