Thursday 22 March 2012

PHP Form

First Create "Welcome.php" file as follows
==================
<html>
<head>
<title>Welcome</title>
</head>
<body>
Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.
</form>
</body>
</html>

Create "Form.php" as follows
======================
html>
<head>
<title>Form</title>
</head>
<body>
<form action="welcome.php" method="post">
Name: <input type="text" name="fname" /><BR/>
Age: <input type="text" name="age" /><BR/>
<input type="submit" />
</form>
</body>
</html>


Output
=====
Welcome SATEESH.BAGADHI!
You are 28 years old.

No comments:

Post a Comment