hello i need this script do u have ??? i will make for my school
Exam results script
Collapse
X
-
Create a page and give it a name mark.html and put this code in bodyCode:<form action="symbol.php" method="POST">Enter mark <input type="text" name="mark"></form>
PHP Code:<?php
$mark = $_POST['mark'];
switch($mark)
{
case "$mark > 79" : print "A ".$mark;
break;
case "$mark > 69" : print "B ".$mark;
break;
case "$mark > 59" : print "C ".$mark;
break;
case "$mark > 49" : print "D ".$mark;
break;
case "$mark > 39" : print "E ".$mark;
break;
default : print 'Shame';
}
?>
Comment
-
here is a simple example with array .. if you want i'll make one with mysql :P
PHP Code:<?php
$arr = array(
array('firstname'=>'Lazar', 'surname'=>'Marghioala', 'grade'=>'A'),
array('firstname'=>'Avram', 'surname'=>'Antoneta', 'grade'=>'B'),
array('firstname'=>'Lazar', 'surname'=>'Gheorghe', 'grade'=>'C'),
array('firstname'=>'Cacatgros', 'surname'=>'Dumitru', 'grade'=>'A+'),
);
?>
<table border="1">
<tr>
<th>No.</th>
<th>Firstname</th>
<th>Surname</th>
<th>Grade</th>
</tr>
<?php foreach ($arr AS $key=>$students):?>
<tr>
<td><?php echo ($key+1)?></td>
<td><?php echo $students['firstname']?></td>
<td><?php echo $students['surname']?></td>
<td><?php echo $students['grade']?></td>
</tr>
<?php endforeach;?>
</table><?php unlink('World/Europe/Romania.country'); ?>
Comment
-
<?php
// mysql conexion ....
//
$query = mysql_query("SELECT `firstname`, `surname`, `grade` FROM `students`");
?>
<table border="1">
<tr>
<th>No.</th>
<th>Firstname</th>
<th>Surname</th>
<th>Grade</th>
</tr>
<?php
$no = 0;
while ($row = mysql_fetch_object($query)){?>
<tr>
<td><?php echo (++$no)?></td>
<td><?php echo $row->firstname?></td>
<td><?php echo $row->surname?></td>
<td><?php echo $row->grade?></td>
</tr>
<?php } ?>
</table>
change how you want:P<?php unlink('World/Europe/Romania.country'); ?>
Comment
Comment