Ex No: 1 Write a program to create Student Registration Form
Aim: To create student registration form using php
Algorithm
Step1: Design a webpage to get student details Name, Roll No, Course and College details
Step2: On form submit check if student name is set and not empty
   A) Get values of student name, roll no, course and college from POST method
   B) Display the details
Source Code

index.html


<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title>Student Registration</title>
 </head>
 <body>
  <h3>Student Registration Form</h3>
  <form id="myform" name="myform" method="POST" action="ex1.php">
   <table>
  <tr>
   <td>Student Name:</td>
   <td>
    <input type="text" id="name" name="name"/>
   </td>
  </tr>
  <tr>
   <td>Roll No:</td>
   <td>
    <input type="text" id="rollno" name="rollno"/>
   </td>
  </tr>
  <tr>
   <td>Course:</td>
   <td>
    <input type="text" id="course" name="course"/>
   </td>
  </tr>
  <tr>
   <td>College:</td>
   <td>
    <input type="text" id="colg" name="colg"/>
   </td>
  </tr>
  <tr>
   <td>
    <input type="submit" value="Register"/>
   </td>
    <td><input type="reset"/></td>
  </tr>
  </table>
  </form>
 </body>
</html>

ex1.php


<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title>Student Registration</title>
 </head>
 <body>
 <?php
  if(isset($_POST["name"]) && $_POST["name"]!="")
  {
	$name = $_POST["name"];
	$roll = $_POST["rollno"];
	$course = $_POST["course"];
	$colg = $_POST["colg"];
  ?>
  <h4>Registration Successful</h4>
  <table>
   <tr>
  	<td>Name: </td>
	<td><?php echo $name; ?></td>
   </tr>
   <tr>
	<td>Roll No: </td>
	<td><?php echo $roll; ?></td>
   </tr>
   <tr>
	<td>Course: </td>
	<td><?php echo $course; ?></td>
   </tr>
   <tr>
	<td>College: </td>
	<td><?php echo $colg; ?></td>
   </tr>
  </table>
 <?php
  }
 ?>
 </body>
</html>
Result: Thus a webpage is designed to get student details and displayed using PHP.