<style>
.option
{
width:175px;
}
.question
{
font-size:20px;
font-weight:bold;
}
</style>
<script>
function abc()
{
rollno=document.forms["check"]["rollno"].value;
if(rollno=="")
{
alert("Please Fill Your Roll No.");
return false;
}
name=document.forms["check"]["name"].value;
if(name=="")
{
alert("Please Fill Your Name");
return false;
}
teacher=document.forms["check"]["teacher"].value;
if(teacher=="")
{
alert("Please Select Your Teacher Name");
return false;
}
timing=document.forms["check"]["timing"].value;
if(timing=="")
{
alert("Please Select Your Class Timing");
return false;
}
course=document.forms["check"]["course"].value;
if(course=="")
{
alert("Please Select Your Course Name");
return false;
}
upload=document.forms["check"]["upload"].value;
if(upload=="")
{
alert("Please Upload Your Picture");
return false;
}
}
</script>
<body bgcolor="white">
<form method="post" action="info.php" enctype="multipart/form-data" name="check">
<h1 align="center">Online Examination System</h1>
<table width="900" align="center">
<form action="info.php" method="POST">
<tr>
<td>Rollno</td>
<td>
<input type="text" name="rollno" size="40">
</td>
<td>Name</td>
<td>
<input type="text" name="name" size="40">
</td>
</tr>
<tr>
<td>Teacher</td>
<td>
<select name="teacher">
<option value="">Select-Teacher</option>
<option value="Sir Majid">Sir Majid</option>
<option value="Sir Tahir">Sir Tahir</option>
<option value="Sir Ali">Sir Ali</option>
<option value="Sir Atif">Sir Atif</option>
<option value="Sir Javed">Sir Javed</option>
</select>
</td>
<td>Timing</td>
<td>
<select name="timing">
<option>Select-Paper-Timing</option>
<option value="09:00 am">09:00 am</option>
<option value="10:00 am">10:00 am</option>
<option value="11:00 am">11:00 am</option>
<option value="12:00 pm">12:00 pm</option>
<option value="01:00 pm">01:00 pm</option>
</select>
</td>
</tr>
<tr>
<td>Select-Paper</td>
<td>
<select name="paper">
<option>Select-Paper</option>
<option value="Web designing">Web designing</option>
<option value="Graphic designing">Graphic designing</option>
<option value="Hardware">Hardware</option>
<option value="IELTS">IELTS</option>
<option value="JAVA">JAVA</option>
</select>
</td>
<td>Picture</td>
<td><input type="file" name="upload">
</td>
</tr>
</table>
<br>
<br>
<br>
<br>
<table border="1" align="center" width="1000">
<tr>
<td>
<h1 align="left">Q1.What Is HTML???</h1>
<input type="radio" name="q1" value="10">Hypertext Markup Language
<br>
<br>
<input type="radio" name="q1" value="0">Hyper markup languages
<br>
<br>
<input type="radio" name="q1" value="0">text markup languages
<br>
<br>
<input type="radio" name="q1" value="0">markup languages
</td>
</tr>
<tr>
<td>
<h1 align="left">Q2.What Is Css???</h1>
<input type="radio" name="q2" value="10">Cascading Style Sheets
<br>
<br>
<input type="radio" name="q2" value="0">Computer Style Sheets
<br>
<br>
<input type="radio" name="q2" value="0">Camera Style Sheets
<br>
<br>
<input type="radio" name="q2" value="0">daynamic Style Sheets
</td>
</tr>
<tr>
<td>
<h1 align="left">Q3.What Is Flash???</h1>
<input type="radio" name="q3" value="10">multimedia
<br>
<br>
<input type="radio" name="q3" value="0">aminnatinon
<br>
<br>
<input type="radio" name="q3" value="">multimedia
<br>
<br>
<input type="radio" name="q3" value="0">multimedia
</td>
</tr>
<tr>
<td>
<h1 align="left">Q4.What Is Adobe Photoshop???</h1>
<input type="radio" name="q4" value="0">Hyper text markup languages
<br>
<br>
<input type="radio" name="q4" value="10">Adobe Photoshop is a raster graphics editor developed and published by Adobe Systems for Windows and OS X.
<br>
<br>
<input type="radio" name="q4" value="0">Hyper text markup languages
<br>
<br>
<input type="radio" name="q4" value="0">Hyper text markup languages
</td>
</tr>
<tr>
<td>
<h1 align="left">Q5.What Is PHP???</h1>
<input type="radio" name="q5" value="10">Hypertext Preprocessor
<br>
<br>
<input type="radio" name="q5" value="0">Preprocessor
<br>
<br>
<input type="radio" name="q5" value="0">text Preprocessor
<br>
<br>
<input type="radio" name="q5" value="0">Hyper Preprocessor
</td>
</tr>
<tr>
<td align="center">
<input type="Submit" value="Paper Complete">
</td>
</tr>
</form>
</table>
info
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<?php
$server="localhost";
$user="root";
$password="";
$database="exam";
$con=mysql_connect($server,$user,$password);
mysql_select_db($database,$con);
$rollno=$_POST["rollno"];
$name=$_POST["name"];
$teacher=$_POST["teacher"];
$timing=$_POST["timing"];
$paper=$_POST["paper"];
$name1=$_FILES["upload"]["name"];
$type=$_FILES["upload"]["type"];
$size=$_FILES["upload"]["size"]/1024;
$path=$_FILES["upload"]["tmp_name"];
move_uploaded_file($path,"file/".$name1);
$q1=$_POST["q1"];
$q2=$_POST["q2"];
$q3=$_POST["q3"];
$q4=$_POST["q4"];
$q5=$_POST["q5"];
$obtainedmarks=($q1+$q2+$q3+$q4+$q5);
$totalmarks=50;
?>
<table align="center" border="1" width="700" height="330">
<tr>
<td colspan="3"><h1 align="center"> Result Card </h1></td>
</tr>
<tr>
<td width="150"><b>Roll No.</b></td>
<td width="350"><?php echo $rollno;?></td>
<td rowspan="7" width="100">
<?php echo '<img src="file/'.$name1.'" width="200" height="240"> ';?>
</td>
</tr>
<tr>
<td><b>Name</b></td>
<td><?php echo $name;?></td>
</tr>
<tr>
<td><b>Teacher</b></td>
<td><?php echo $teacher;?></td>
</tr>
<tr>
<td><b>Timing</b></td>
<td><?php echo $timing;?></td>
</tr>
<tr>
<td><b>Paper</b></td>
<td><?php echo $paper;?></td>
</tr>
<tr>
<td><b>Obtained Marks</b></td>
<td><?php echo $obtainedmarks;?></td>
</tr>
<tr>
<td><b>Total Marks</b></td>
<td><?php echo $totalmarks;?></td>
</tr>
</table>
<table align="center" border="1" width="700" height="300">
<tr>
<td colspan="2"><h2 align="center">Questions and Marks </h2></td>
</tr>
<tr>
<?php if($q1==10){ ?>
<td><b>Q1.What Is HTML???</b></td>
<?php } ?>
<?php if($q1==0){ ?>
<td><font color="red"><b>Q1.What Is HTML???</b></font></td>
<?php } ?>
<?php if($q1==10){ ?>
<td><?php echo $q1;?></td>
<?php } ?>
<?php if($q1==0){ ?>
<td><font color="red"><?php echo $q1;?></font></td>
<?php } ?>
</tr>
<tr>
<?php if($q2==10){ ?>
<td><b>Q2.What Is Css???</b></td>
<?php } ?>
<?php if($q2==0){ ?>
<td><font color="red"><b>Q2.What Is Css???</b></font></td>
<?php } ?>
<?php if($q2==10){ ?>
<td><?php echo $q2;?></td>
<?php } ?>
<?php if($q2==0){ ?>
<td><font color="red"><?php echo $q2;?></font></td>
<?php } ?>
</tr>
<tr>
<?php if($q3==10){ ?>
<td><b>Q3.What Is Flash???</b></td>
<?php } ?>
<?php if($q3==0){ ?>
<td><font color="red"><b>Q3.What Is Flash???</b></font></td>
<?php } ?>
<?php if($q3==10){ ?>
<td><?php echo $q3;?></td>
<?php } ?>
<?php if($q3==0){ ?>
<td><font color="red"><?php echo $q3;?></font></td>
<?php } ?>
</tr>
<tr>
<?php if($q4==10){ ?>
<td><b>Q4.What Is Adobe Photoshop???</b></td>
<?php } ?>
<?php if($q4==0){ ?>
<td><font color="red"><b>Q4.What Is Adobe Photoshop???</b></font></td>
<?php } ?>
<?php if($q4==10){ ?>
<td><?php echo $q4;?></td>
<?php } ?>
<?php if($q4==0){ ?>
<td><font color="red"><?php echo $q4;?></font></td>
<?php } ?>
</tr>
<tr>
<?php if($q5==10){ ?>
<td><b>Q5.What Is PHP???</b></td>
<?php } ?>
<?php if($q5==0){ ?>
<td><font color="red"><b>Q5.What Is PHP???</b></font></td>
<?php } ?>
<?php if($q5==10){ ?>
<td><?php echo $q5;?></td>
<?php } ?>
<?php if($q5==0){ ?>
<td><font color="red"><?php echo $q5;?></font></td>
<?php } ?>
</tr>
</table>
<?php
mysql_query("insert into data (rollno,name,teacher,timing,paper,picture,q1,q2,q3,q4,q5,obtainedmarks,totalmarks) values('$rollno','$name','$teacher','$timing','$paper','$name1','$q1','$q2','$q3','$q4','$q5','$obtainedmarks','$totalmarks')");
?>
</body>
</html>
No comments:
Post a Comment