PHP “Post ” in forms example

<!DOCTYPE html>
<html>
<body>

<form method=”post” action=”<?php echo $_SERVER[‘PHP_SELF’];?>“>
Name: <input type=”text” name=”fname”>
<input type=”submit”>
</form>

<?php
$name = $_POST[‘fname’];
echo $name;
?>


</body>
</html>

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.