latest Post

PHP Registration form using GET, POST Methods with example


Program :

HTML Code
<html>
<head>
<title>Student Info</title>
</head>
<body><center>
<h3> Student Details </h3>
<form action="printval.php" method=post><br><br>
Roll No: <input type="text" name="rollno"><br><br>
Name: <input type="text" name="stname"><br><br>
Address: <input type="text" name="address"><br><br>
<table>
<tr>
<td>
Select Gender :</td> <td><input type="radio" name="sex" value="male" checked>Male
</td>
<td><input type="radio" name="sex" value="female">Female</td>
</tr>
</table>
<br><br>Phone No: <input type="text" name="phoneno"><br><br>
<input type=submit>
</form></center>
</body>
</html>

PHP Code - Filename : printval.php

<html>
<head>
<title> print stud detail</title>
</head>
<body>
<center>
<font color="red"><h3>Student Details</h3></font>
<form>
Roll No: <input type=Label value="<?php echo $_POST["rollno"] ?>"><br><br>
Name: <input type=Label value="<?php echo $_POST["stname"] ?>"><br><br>
Address: <input type=Label value="<?php echo $_POST["address"] ?>"><br><br>
Gender: <input type=Label value="<?php echo $_POST["sex"] ?>"><br><br>
Phone No: <input type=Label value="<?php echo $_POST["phoneno"] ?>">
</form>
</center>
</body>
</html>

Output : 




About Open Learning Creative

Open Learning Creative
Recommended Posts × +

0 comments:

Post a Comment

PHP Registration form using GET, POST Methods with example

Program : HTML Code <html> <head> <title>Student Info</title> </head> <body><center> ...