Viewing file: calcultor.php (4.05 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php session_start(); ?> <?php include('session.php'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Student Login Panel </title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css"> <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" /> <script type='text/javascript'> $(document).ready(function(){ $("img.a").hover( function() { $(this).stop().animate({"opacity": "0"}, "slow"); }, function() { $(this).stop().animate({"opacity": "1"}, "slow"); });
}); </script> <style type="text/css"> table { border: 0px solid green; border-collapse: collapse; width:100%; }
table td { border: 0px solid green; }
table td.shrink { white-space:nowrap } table td.expand { width: 99% } </style> <style>
.table {
table-layout:fixed; width:500px;
border-collapse:collapse;
}
.header th {
font-family:Calibri; font-size:small; font-weight:lighter;
border-left:1px solid #000; background:#d0d0d0;
}
.body_panel {
display:inline-block; width:520px; height:300px; overflow-y:scroll;
}
.body tr {
border-bottom:1px solid #d0d0d0;
}
.body td {
border-left:1px solid #d0d0d0; padding-left:3px;
font-family:Calibri; font-size:small;
overflow:hidden; white-space:nowrap; text-overflow:ellipsis;
} </style> </head> <center> <body class="w3-container"> <table > <tr> <td colspan="2"><table width="945" border="0"> <tr> <td colspan="3" bgcolor="#CCCCCC"> <?php include('menubar/menubar.php'); ?></td> </tr> <tr> <td colspan="3" bgcolor="#CCCCCC"> <?php include('sessionbar.php'); ?></td> </tr> <tr> </tr> </table></td> </tr> <tr> <td colspan="2" align="center"> <?php include('session.php'); ?> <script language="javascript" type="text/javascript"> document.onkeydown = function(){ switch (event.keyCode){ case 116 : //F5 button event.returnValue = false; event.keyCode = 0; return false; case 82 : //R button if (event.ctrlKey){ event.returnValue = false; event.keyCode = 0; return false; } } } </script> <?php
$con=mysqli_connect("localhost", "sql_itce_co_in", "02a26fb2e4265", "sql_itce_co_in"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $dates=date("d/m/y");
$counts=$_POST['countss']+1; $rollnosss=$_POST['rollnos']; $recod=$counts-1;
for($i=0;$i<$counts; $i++) {
$radios=$_POST['radiocount'];
$succ=$_POST['cans']; if($radios[$i]>NULL) { $success= $succ[$i]; $choice=$radios[$i]; if($success==$choice) { $score=$score+1; } else { $score=$score; } } }
$stdname=$_POST['stdname']; $fname=$_POST['fname']; $batchno=$_POST['classes']; $rollno=$_POST['rollno']; $sql = "INSERT INTO answersheet (date,totlaquestion,correctanswer,name,batch_no,roll_no) VALUES ('$dates','$recod','$score','$stdname','$batchno','$rollno')";
if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error($con));
} mysqli_close($con);
?>
<table width="600" border="1"> <tr> <td colspan="3" bgcolor="#FF6600" align="center">THANKS MR. <?PHP echo $user ?></td> </tr> <tr> <td width="200">Total Question:</td> <td width="200"><?PHP echo $recod ?></td> </tr> <tr> <td>Correct Answer</td> <td><?PHP echo $score ?></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td colspan="3" bgcolor="#FF6600" align="center"><a href="result.php">CLOSE </a></td> </tr> </table> </td> </tr> <tr> <td colspan="2" bgcolor="#CCCCCC"><?php include('footer/footer.php'); ?></td> </tr> </table>
</body></center> </html>
|