RaZ0oR
Neues Mitglied
Hi, ich hab für unsere Klassenhp einen notendurschnitts rechner erstellt....
aber leider funkt der nicht.....
aber leider funkt der nicht.....
PHP:
//der html teil dürfte glaube ich klar sein
<?php
if(!isset($_POST["formular"])) {
?>
</p>
<div align="left">
<form action="<?php echo $_SERVER["PHP_SELF"];?>" method="POST"> <table width="300">
<tr>
<td width="243">
1. Schulaufgabe </td>
<td width="45">
<input type="text" name="s1" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0">
</td>
</tr>
<tr>
<td>
2. Schulaufgabe
</td>
<td>
<input type="text" name="s2" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0">
</td>
</tr>
<tr>
<td>
3. Schulaufgabe
</td>
<td>
<input type="text" name="s3" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0">
</td>
</tr>
<tr>
<td>
4. Schulaufgabe
</td>
<td>
<input type="text" name="s4" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0">
</td>
</tr>
</table><br> <table width="300">
<tr>
<td width="243"> 1. EX </td>
<td width="45"><input type="text" name="e1" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0">
</td>
</tr>
<tr>
<td> 2. EX </td>
<td><input type="text" name="e2" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0">
</td>
</tr>
<tr>
<td> 3. EX </td>
<td><input type="text" name="e3" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0">
</td>
</tr>
<tr>
<td> 4. EX </td>
<td><input type="text" name="e4" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0">
</td>
</tr>
<tr>
<td> 5. EX </td>
<td><input type="text" name="e5" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0"><br>
</td>
</tr>
</table><br>
<table width="300">
<tr>
<td width="243"> 1. Mündliche Note</td>
<td width="45"><input type="text" name="m1" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0"> </td>
</tr>
<tr>
<td> 2. Mündliche Note </td>
<td><input type="text" name="m2" style="width:20px; background:#CCCCCC; color:#993300; font:bold;" value="0"> </td>
</tr>
<tr>
<td><input name="formular" type="submit" value="Ausrechnen">
<input type="reset" value="Zürcksetzen"></td>
<td> </td>
</tr>
</table>
</form>
</div>
<?php
}
elseif ($_POST['s1'] >= 1 AND $_POST['s1'] <= 6) { //die note darf nur zwischen 1 und 6 sein, bei den untetren beispielen auch alle
$s1 = $_POST['s1'];//wenn dies zutrifft, wird der $s1, den wert vom obigen formular übertragen!!!
$anzahl. + 2;
}
elseif ($_POST['s2'] >= 1 AND $_POST['s2'] <= 6) {
$s2 = $_POST['s2'];
$anzahl. + 2;
}
elseif ($_POST['s3'] >= 1 AND $_POST['s3'] <= 6) {
$s3 = $_POST['s'];
$anzahl. + 2;
}
elseif ($_POST['s4'] >= 1 AND $_POST['s4'] <= 6) {
$s4 = $_POST['s4'];
$anzahl. + 2;
}
elseif ($_POST['e1'] >= 1 AND $_POST['e1'] <= 6) {
$e1 = $_POST['e1'];
$anzahl. + 1;
}
elseif ($_POST['e2'] >= 1 AND $_POST['e2'] <= 6) {
$e2 = $_POST['e2'];
$anzahl. + 1;
}
elseif ($_POST['e3'] >= 1 AND $_POST['e3'] <= 6) {
$e3 = $_POST['e3'];
$anzahl. + 1;
}
elseif ($_POST['e4'] >= 1 AND $_POST['e4'] <= 6) {
$e4 = $_POST['e4'];
$anzahl. + 1;
}
elseif ($_POST['e5'] >= 1 AND $_POST['e5'] <= 6) {
$e5 = $_POST['e5'];
$anzahl. + 1;
}
elseif ($_POST['m1'] >= 1 AND $_POST['m1'] <= 6) {
$m1 = $_POST['m1'];
$anzahl. + 1;
}
elseif ($_POST['m2'] >= 1 AND $_POST['m2'] <= 6) {
$m2 = $_POST['m2'];
$anzahl. + 1;
}
else {
print("<br>");
print(/*hier steht dann die rechnung*/); // bei der rechnung ist dann auch schon das problem, die noten müssen ja addiert werden, das müsste eigendlich funktionieren, aber auch durch die anzahl der noten geteilt werden die es gibt, und das schaffe ich nicht, habt ihr verstanden was ich meine^^
}
?>