04 Student Mark List Program PHP- record
Note:- Two programs
01- Student form
02-Result details ...
save--result4a.PHP
program:-01
<html>
<form action="student4b.php">
<table>
<caption>STUDENT MARKSHEET FORM</caption>
<tr>
<td>School Name</td>
<td><input type="text" name="sn" size="30"></td>
</tr>
<tr>
<td>Student Name</td>
<td><input type="text" name="stn" size="30"></td>
</tr>
<tr>
<td>Father's Name</td>
<td><input type="text" name="fn" size="30"></td>
</tr>
<tr>
<td>Dob</td>
<td><input type="text" name="dob" size="30"></td>
</tr>
<tr>
<td>Gender</td>
<td><input type="radio" name="gen" size="30" value="Male">Male
<input type="radio" name="gen" size="30" value="Female">Female</td>
</tr>
<tr>
<td>Hindi marks</td>
<td><input type="text" name="hin" size="30"></td>
</tr>
<tr>
<td>English marks</td>
<td><input type="text" name="eng" size="30"></td>
</tr>
<tr>
<td>Maths marks</td>
<td><input type="text" name="math" size="30"></td>
</tr>
<tr>
<td>Physics marks</td>
<td><input type="text" name="phy" size="30"></td>
</tr>
<tr>
<td>Chemistry marks</td>
<td><input type="text" name="chem" size="30"></td>
</tr>
<tr>
<td><input type="submit"></td>
<td><input type="reset"></td>
</tr>
</table>
</form>
</html>
save--student4b.PHP
program:-02
<html>
<?php
$sn=$_GET['sn'];
$stn=$_GET['stn'];
$fn=$_GET['fn'];
$dob=$_GET['dob'];
$gender=$_GET['gen'];
$hindi=$_GET['hin'];
$english=$_GET['eng'];
$maths=$_GET['math'];
$physics=$_GET['phy'];
$chemistry=$_GET['chem'];
$total=$hindi+$english+$maths+$physics+$chemistry;
$remark1=0;
$remark2=0;
$remark3=0;
$remark4=0;
$remark5=0;
$count=0;
$s="a";
$gen='';
$min=35;
$max=100;
$hin='Hindi';
$eng='English';
$math='Maths';
$phy='Physics';
$chem='Chemistry';
if($gender=="Male")
{
$gen="S/o";
}else
if($gender=="Female")
{
$gen="D/o";
}
if($hindi<35)
{
$remark1="<font color='red'>*</font>";
$count++;
$s=$s.' and '.$hin;
}else
if($hindi>79)
{
$remark1="<font color='green'>A</font>";
}else
{
$remark1='-';
}
if($english<35)
{
$remark2="<font color='red'>*</font>";
$count++;
$s=$s.' and '.$eng;
}else
if($english>79)
{
$remark2="<font color='green'>A</font>";
}else
{
$remark2='-';
}
if($maths<35)
{
$remark3="<font color='red'>*</font>";
$count++;
$s=$s.' and '.$math;
}else
if($maths>79)
{
$remark3="<font color='green'>A</font>";
}else
{
$remark3='-';
}
if($physics<35)
{
$remark4="<font color='red'>*</font>";
$count++;
$s=$s.' and '.$phy;
}else if($physics>79)
{
$remark4="<font color='green'>A</font>";
}else
{
$remark4='-';
}
if($chemistry<35)
{
$remark5="<font color='red'>*</font>";
$count++;
$s=$s.' and '.$chem;
}else
if($chemistry>79)
{
$remark5="<font color='green'>A</font>";
}else
{
$remark5='-';
}
$s=str_replace('a and', '', $s);
if($count>2)
{
$s="Fail";
}else if($count==0)
{
$s="Pass";
}else if($count<=2)
{
$s="Compartment in ".' '.$s;
}
?>
<center>
<table border=1>
<tr>
<td>
<table width=100%>
<tr>
<td>
<img src="images/ibmlogo.jpg" width="120" height="120">
</td>
<td>
<b>
<font size='5'>
BOARD OF SECONDARY EDUCATION
</font>
</b><br><br>
<font size='4' color='grey'>
<b><?php echo "$sn"; ?></b>
</font>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width=100%>
<tr>
<td>
<font size='4'>
<?php echo "$stn"; ?>
<?php echo "$gen";?>
<?php echo" Mr.$fn";?>
</font>
</td>
</tr>
<tr>
<td>
<font size='4'>
<?php echo "$dob"?>
<?php echo"$gender";?>
</font>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border=1 width=100%>
<tr>
<th><i>Subject code</i></th>
<th><i>Subject name</i></th>
<th><i>Min marks</i></th>
<th><i>Max marks</i></th>
<th><i>Marks obtained</i></th>
<th><i>Remark</i></th>
</tr>
<tr>
<td>101</td>
<td>Hindi</td>
<td>35</td>
<td>100</td>
<td><?php echo "$hindi"; ?></td>
<td><?php echo "$remark1"; ?></td>
</tr>
<tr>
<td>102</td>
<td>English</td>
<td>35</td>
<td>100</td>
<td><?php echo "$english"; ?></td>
<td><?php echo "$remark2"; ?></td>
</tr>
<tr>
<td>103</td>
<td>Maths</td>
<td>35</td>
<td>100</td>
<td><?php echo "$maths"; ?></td>
<td><?php echo "$remark3"; ?></td>
</tr>
<tr>
<td>104</td>
<td>Physics</td>
<td>35</td>
<td>100</td>
<td><?php echo "$physics"; ?></td>
<td><?php echo "$remark4"; ?></td>
</tr>
<tr>
<td>105</td>
<td>Chemistry</td>
<td>35</td>
<td>100</td>
<td><?php echo "$chemistry"; ?></td>
<td><?php echo "$remark5"; ?></td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td>
<b>Total</b>
</td>
<td>
<b>400</b>
</td>
<td>
<b><?php echo "$total"; ?></b>
</td>
<td>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td>
<b>
<font size='4'>
Result:
<?php echo "$s"; ?>
</font>
</b>
</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</html>
output:- 1-1
click----result4a.php
submit
output:- 1-2
output:- 2-1
click----result4a.php
submit
output:- 2-2
output:- 3-1
click----result4a.php
submit
output:- 3-2
Comments
Post a Comment