First create a webpage that contain a form.
<html>
<head>
<title>Form</title>
</head>
<body>
<center>
<h2>Registration Form</h2>
<form method="POST" action="FormRequestMethod2.php"> <!-- Here we can use POST or GET method whatever we want to use -->
<table>
<tr>
<td>
Enter Your Name:
</td>
<td>
<input type="text" name="username"/><br/>
</td>
</tr>
<tr>
<td>
Enter Email Id :
</td>
<td>
<input type="text" name="email"/><br/>
</td>
</tr>
<tr>
<td>
Enter Your Password :
</td>
<td>
<input type="password" name="password"/><br/>
</td>
</tr>
<tr>
<td></td>
<td>
<input type="submit" name="submit" value="Submit" />
</td>
</tr>
</table>
</form>
</center>
</body>
</html>
Now create another page and name it FormRequestMethod2.PHP
<html>
<head>
<title>Result of previous page</title>
</head>
<body>
<center>
<h2>Your information is as below</h2>
<table>
<tr>
<td>
User Name :
</td>
<td>
<?php echo $_REQUEST['username']; ?>
</td>
</tr>
<tr>
<td>
Email Id :
</td>
<td>
<?php echo $_REQUEST['email']; ?>
</td>
</tr>
<tr>
<td>
Password :
</td>
<td>
<?php echo $_REQUEST['password']; ?>
</td>
</tr>
</table>
</body>
</html>


No comments:
Post a Comment