html form php code example
Example: php form
/* POST */
<?php
if(isset($_POST)) {
echo("Name : ".$_POST["name"]."<br>E-mail :".$_POST["email"]."<br><br>");
}
?>
<html>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>
</body>
</html>
/* GET */
<?php
if(isset($_GET)) {
echo("Name : ".$_GET["name"]."<br>E-mail :".$_GET["email"]."<br><br>");
}
?>
<html>
<body>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
Name: <input type="text" name="name"><br>
E-mail: <input type="text" name="email"><br>
<input type="submit">
</form>
</body>
</html>