Santosh Kumar Das
Query: 1 / Answer: 2

21st Sep 2017 .

Create a PHP file which shows the following form with given design.

When a user click on NEXT button, it validates the non empty validation & then move to next page. Next page contain the name & prefix collected from 1st page. If a user enter name as Sangita Swain & gender female, the design will given below.

After click on UPLOAD button it moves to the last page & display as given below

NB:
 This assignment should be completed in three pages with proper designs.
 Can also use CSS as per required.
 Don’t use database connection.

Answers

Biswajit Swain
Query: 1 / Answer: 42

21st Sep 2017 .

Require 3 php page. I have used index.php, form9.php & last9.php

======================index.php===============================

<?php 
session_start();
ob_start();
?>
<form method="post" enctype="multipart/form-data">
<table width="448" bordercolor="#333333" align="center" >
  <tr>
    <td colspan="3"><div align="center">STUDENT REGISTRATION FORM 1</div></td>
  </tr>
  <tr bordercolor="#FFFFFF">
    <td width="81">Name </td>
    <td width="18">::</td>
    <td width="327"><input type="text" name="name"  /></td>
  </tr>
  <tr>
   <td>Gender</td>
    <td>::</td>
    <td><input name="gender" type="radio" value="male" checked="checked" />Male
<input name="gender" type="radio" value="female" />Female
</td>
  </tr>
  
  <tr>
    <td colspan="3"><div align="center">
      <label>
      <input type="submit" name="submit" value="Next" />
      </label>
    </div></td>
  </tr>
</table>
</form>
<?php 
if(isset($_POST['submit'])){
if(($_POST['name']=="")||($_POST['name']=="")){
echo "Enter  field";
}
else{
$_SESSION['name']=$_POST['name'];
$_SESSION['gender']=$_POST['gender'];
header('Location:form9.php');
}
 
 
 
}
 
?>
 
===========================================================================
==============================form9.php======================================
<?php 
ob_start();
session_start();
 
?>
 
<form method="post" enctype="multipart/form-data">
<table width="448" bordercolor="#333333" align="center" >
  <tr>
    <td><div align="center">STUDENT REGISTRATION FORM </div></td>
  </tr>
  <tr bordercolor="#FFFFFF">
    <td>Welcome <?php if ($_SESSION['gender']=="male"){?>Mr. <?php echo $_SESSION['name'];}else{ ?>Miss <?php echo $_SESSION['name']; }?></td>
    </tr>
  <tr>
   <td>    <input name="image" type="file" id="image"/></td>
    </tr>
  
  <tr>
    <td><div align="center">
      <label>
      <input type="submit" name="submit" value="Upload" />
      </label>
    </div></td>
  </tr>
</table>
</form>
<?php
if(isset($_POST['submit'])){
if(($_FILES["image"]["type"]=="image/gif")
|| ($_FILES["image"]["type"]=="image/jpeg")
|| ($_FILES["image"]["type"]=="image/png")
|| ($_FILES["image"]["type"]=="image/jpg")
){
$r=rand(99,999);
$img=$r.basename($_FILES["image"]["name"]);
if(@move_uploaded_file($_FILES["image"]["tmp_name"],$img)){
$_SESSION['img']=$img;
header('Location:last9.php');
}
}
}
 
 ?>

==============================================================================

===========================last9.php===========================================

<?php session_start();?>
 
<form method="post" enctype="multipart/form-data">
<table width="448" bordercolor="#333333" align="center" >
  <tr>
    <td colspan="2"><div align="center">STUDENT REGISTRATION FORM </div></td>
  </tr>
  <tr bordercolor="#FFFFFF">
    <td colspan="2">Welcome <?php if ($_SESSION['gender']=="male"){?>Mr. <?php echo $_SESSION['name'];}else{ ?>Miss <?php echo $_SESSION['name']; }?></td>
    </tr>
  <tr>
   <td rowspan="2"><img src="<?php echo $_SESSION['img'];?>" style="width:100px; height:100px;"/></td>
    <td> Profile Created</td>
  </tr>
  
</table>
</form>
============================================================================

  •  Information
  • About Forum

    This educational forum is produly developed by betaQsolutions-A leading software company in Odisha. This forum is developed to discuss the educational topics only betweeen the Students, teachers, Parents & Experts. Topic related to Career, Syllabus, Subjects, Questions, Exams etc are allowed to discuss here.

  • Statistics

    Total topics 43 • Total Query 1114 • Total members 247 • Total Answered 1285