#99. PHP $_SERVER
How to Show data won page.
Run Code:
<!DOCTYPE html>
<html>
<head>
<title>Simple Form</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
Name : <input type="text" name="fname"><br><br>
Age : <input type="text" name="age"><br><br>
<input type="submit" name="save">
</form>
<?php
if(isset($_POST['save']))
{
echo $_POST['fname'] . "<br>";
echo $_POST['age'] . "<br>";
}
?>
</body>
</html>
O/P



Comments
Post a Comment