Egal was ich änder, er trägt die Daten nicht in die DB ein... Kommt immer "Eintrag fehlgeschlagen". Ich kann aber kein Fehler finden... Bin Ratlos...
add_klausur_auswahl.php
add_klausur.php
add_klausur_made.php
Datenbank:
add_klausur_auswahl.php
PHP:
<?php
include ("checkuser.php");
?>
<html>
<body>
<center>
<b>Klausur erstellen für:</b><br>
<br>
</center>
<?
$host = "localhost";
$user = "";
$password = "";
$dbname = "";
$tabelle ="f95_uni_noten";
$dbverbindung = mysql_connect ($host, $user, $password);
$dbanfrage = "SELECT * from $tabelle";
$result = mysql_db_query ($dbname, $dbanfrage, $dbverbindung);
while ($ausgabe = mysql_fetch_array ($result))
echo "<LINK href='style.css' type=text/css rel=stylesheet>
<div align='center'>
<table border='0' width='20%'>
<tr>
<td width='50%' align='left'> <font size='1' face='Verdana'><b>Vame:</b></td>
<td width='50%' align='left'> <font size='1' face='Verdana'>$ausgabe[vorname]</td>
</tr>
<tr>
<td width='50%' align='left'> <font size='1' face='Verdana'><b>Nachname:</b></td>
<td width='50%' align='left'> <font size='1' face='Verdana'>$ausgabe[nachname]</td>
</tr>
<tr>
<td width='50%' align='left'> <font size='1' face='Verdana'></td>
<td width='50%' align='left'> <font size='1' face='Verdana'>-> <a href='add_klausur.php?id=".$ausgabe[id]."&vorname=".$ausgabe[vorname]."&nachname=".$ausgabe[nachname]."'>erstellen</td>
</tr>
</table>
<br>
";
mysql_close ($dbverbindung);
?>
Aufgrund sogenannter <b>"Einwegverschlüsselung"</b>, können die Nachnamen nicht bzw. nur verschlüsselt angezeigt werden. Dafür ist optimale Sicherheit garantiert.
add_klausur.php
PHP:
<form action="add_klausur_made.php" method="post">
<font size="1" face="Verdana">
<b>Zur Identifikation</b><br>
<br>
Ich erstelle gerade eine Klausur für (<? echo $_GET['vorname']; ?>/<? echo $_GET['nachname']; ?>)<br>
<br>
<br>
<table witdh="80%">
<div align="center">
<tr>
<td width="20%" align="left"><font size="1" face="Verdana">*Name der Klausur:</font></td>
<td width="80%" align="left"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="name_klausur" maxlength="30" size="30"></</td>
</tr>
<tr>
<td width="20%" align="left"><font size="1" face="Verdana">*Datum:</font></td>
<td width="80%" align="left"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="date_klausur" maxlength="30" size="30"></td>
</tr>
<tr>
<td width="20%" align="left"><font size="1" face="Verdana">*Fach:</font></td>
<td width="80%" align="left"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="fach_klausur" maxlength="30" size="30"></td>
</tr>
<tr>
<td width="20%" align="left"><font size="1" face="Verdana"></font></td>
<td width="80%" align="left"><input type="hidden" name="userid" value="<? echo $_GET['id']; ?>" maxlength="30" size="30"></td>
</tr>
<tr>
<td width="20%" align="left"><font size="1" face="Verdana"><br>Credits:</font></td>
</tr>
</td>
</table>
<table witdh="100%">
<div align="center">
<tr>
<td width="10" align="center"><font size="1" face="Verdana">Credits</font></td>
<td width="10" align="center"><font size="1" face="Verdana">1</font></td>
<td width="10" align="center"><font size="1" face="Verdana">2</font></td>
<td width="10" align="center"><font size="1" face="Verdana">3</font></td>
<td width="10" align="center"><font size="1" face="Verdana">4</font></td>
<td width="10" align="center"><font size="1" face="Verdana">5</font></td>
<td width="10" align="center"><font size="1" face="Verdana">6</font></td>
<td width="10" align="center"><font size="1" face="Verdana">7</font></td>
<td width="10" align="center"><font size="1" face="Verdana">8</font></td>
<td width="10" align="center"><font size="1" face="Verdana">9</font></td>
<td width="10" align="center"><font size="1" face="Verdana">10</font></td>
<td width="10" align="center"><font size="1" face="Verdana">11</font></td>
<td width="10" align="center"><font size="1" face="Verdana">12</font></td>
<td width="10" align="center"><font size="1" face="Verdana">13</font></td>
<td width="10" align="center"><font size="1" face="Verdana">14</font></td>
<td width="10" align="center"><font size="1" face="Verdana">15</font></td>
<td width="10" align="center"><font size="1" face="Verdana">16</font></td>
<td width="10" align="center"><font size="1" face="Verdana">17</font></td>
<td width="10" align="center"><font size="1" face="Verdana">18</font></td>
<td width="10" align="center"><font size="1" face="Verdana">19</font></td>
<td width="10" align="center"><font size="1" face="Verdana">20</font></td>
<td width="10" align="center"><font size="1" face="Verdana">*Punkte</font></td>
<td width="10" align="center"><font size="1" face="Verdana">*Gesamt</font></td>
</tr>
<tr>
<td width="10" align="center"><font size="1" face="Verdana">Modul/Note</font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_1" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_2" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_3" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_4" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_5" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_6" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_7" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_8" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_9" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_10" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_11" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_12" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_13" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_14" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_15" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_16" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_17" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_18" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_19" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_20" maxlength="2" size="2"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="modul_points" maxlength="4" size="4"></font></td>
<td width="10" align="center"><font size="1" face="Verdana"><input type="text" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" name="gesamtpunkte" maxlength="4" size="4"></font></td>
</tr>
</td>
</table>
<table witdh="80%">
<div align="center">
<tr>
<td width="20%" align="left"><br></td>
<td width="80%" align="left"><br><input type="submit" style="background-color: #E8E8E8; border: 1px solid #424242; font-family: Verdana; font-size: 9px; color: #000000;" style="background-color: #424242; border: 1px solid #000000; font-family: Verdana; font-size: 9px; color: #000000;" value="hinzufügen"></td>
</tr>
</td>
</table>
</form>
add_klausur_made.php
PHP:
<?php
$host = "localhost";
$user = "";
$password = "";
$dbname = "";
$tabelle ="f95_uni_klausur";
$dbverbindung = mysql_connect ($host, $user, $password);
$name_klausur = $_POST['name_klausur'];
$date_klausur = $_POST['date_klausur'];
$fach_klausur = $_POST['fach_klausur'];
$userid = $_POST['userid'];
$modul_1 = $_POST['modul_1'];
$modul_2 = $_POST['modul_2'];
$modul_3 = $_POST['modul_3'];
$modul_4 = $_POST['modul_4'];
$modul_5 = $_POST['modul_5'];
$modul_6 = $_POST['modul_6'];
$modul_7 = $_POST['modul_7'];
$modul_8 = $_POST['modul_8'];
$modul_9 = $_POST['modul_9'];
$modul_10 = $_POST['modul_10'];
$modul_11 = $_POST['modul_11'];
$modul_12 = $_POST['modul_12'];
$modul_13 = $_POST['modul_13'];
$modul_14 = $_POST['modul_14'];
$modul_15 = $_POST['modul_15'];
$modul_16 = $_POST['modul_16'];
$modul_17 = $_POST['modul_17'];
$modul_18 = $_POST['modul_18'];
$modul_19 = $_POST['modul_19'];
$modul_20 = $_POST['modul_20'];
$modul_points = $_POST['modul_points'];
$gesamtpunkte = $_POST['gesamtpunkte'];
$action = $HTTP_POST_VARS[action];
if($name_klausur == '' or $modul_points == '' or $date_klausur == '' or $fach_klausur == '' or $gesamtpunkte == ''){
echo "<html>
<head>
<title></title>
</head>
<LINK href='style.css' type=text/css rel=stylesheet>
<meta http-equiv='refresh' content='3; URL=intern.php'>
Bitte alle * Felder ausfüllen";
}
else
{
$dbanfrage = "INSERT INTO `f95_uni_klausur` ( `name_klausur` , `date_klausur` , `fach_klausur` , `userid , `modul_1` , `modul_2` , `modul_3` , `modul_4` , `modul_5` , `modul_6` , `modul_7` , `modul_8` , `modul_9` , `modul_10` , `modul_11` , `modul_12` , `modul_13` , `modul_14` , `modul_15` , `modul_16` , `modul_17` , `modul_18` , `modul_19` , `modul_20` , `modul_points` , `gesamtpunkte` ) VALUES ('$name_klausur', '$date_klausur', '$fach_klausur', '$userid', '$modul_1', '$modul_2', '$modul_3', '$modul_4', '$modul_5', '$modul_6', '$modul_7', '$modul_8', '$modul_9', '$modul_10', '$modul_11', '$modul_12', '$modul_13', '$modul_14', '$modul_15', '$modul_16', '$modul_17', '$modul_18', '$modul_19', '$modul_20', '$modul_points', '$gesamtpunkte')";
if (mysql_db_query ($dbname, $dbanfrage, $dbverbindung)) {
print ("<html>
<head>
<title></title>
</head>
<LINK href='style.css' type=text/css rel=stylesheet>
<meta http-equiv='refresh' content='3; URL=intern.php'>
Klausur für xy erfolgreich eingetragen. Er kann sie nun in seinem Profil ansehen.");
} else {
print ("<html>
<head>
<title></title>
</head>
<LINK href='style.css' type=text/css rel=stylesheet>
<meta http-equiv='refresh' content='3; URL=intern.php'>
Eintrag fehlgeschlagen.");
mysql_error();
}
}
mysql_close ($dbverbindung);
?>
Datenbank: