Hallo, ich habe ein kleines Script wo man Klausuren eintragen kann. Allerdings funktioniert das nicht mehr. Ich hatte diese ausversehen in die User-Tabelle gespeichert. Das sollte natürlich nicht so sein - hat aber funktioniert.. Dann habe ich die Tabelle kopiert und einen euen Namen gegeben. Habe auch die ganzen Einträge in den PHP Dateien entsprechend geändert. Nun funktioniert es aber wie gesagt nicht mehr. Kommt die Meldung: Eintrag fehlgeschlagen... mysqlerror() gibt auch nichts aus.
Formular (Auswahl): (add_klausur_auswahl.php)
Formular (Eingabe): add_klausur.php
Verarbeitung: (add_klausur_made.php)
Formular (Auswahl): (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.
Formular (Eingabe): 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="modul1" 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="modul2" 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="modul3" 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="modul4" 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="modul5" 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="modul6" 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="modul7" 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="modul8" 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="modul9" 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="modul10" 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="modul11" 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="modul12" 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="modul13" 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="modul14" 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="modul15" 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="modul16" 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="modul17" 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="modul18" 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="modul19" 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="modul20" 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>
Verarbeitung: (add_klausur_made.php)
PHP:
<?php
$host = "";
$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'];
$modu1 = $_POST['modul1'];
$modu2 = $_POST['modul2'];
$modu3 = $_POST['modul3'];
$modu4 = $_POST['modul4'];
$modu5 = $_POST['modul5'];
$modu6 = $_POST['modul6'];
$modu7 = $_POST['modul7'];
$modu8 = $_POST['modul8'];
$modu9 = $_POST['modul9'];
$modul10 = $_POST['modul10'];
$modul11 = $_POST['modul11'];
$modul12 = $_POST['modul12'];
$modul13 = $_POST['modul13'];
$modul14 = $_POST['modul14'];
$modul15 = $_POST['modul15'];
$modul16 = $_POST['modul16'];
$modul17 = $_POST['modul17'];
$modul18 = $_POST['modul18'];
$modul19 = $_POST['modul19'];
$modul20 = $_POST['modul20'];
$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 , `modul1` , `modul2` , `modul3` , `modul4` , `modul5` , `modul6` , `modul7` , `modul8` , `modul9` , `modul10` , `modul11` , `modul12` , `modul13` , `modul14` , `modul15` , `modul16` , `modul17` , `modul18` , `modul19` , `modul20` , `modul_points` , `gesamtpunkte` ) VALUES ('$name_klausur', '$date_klausur', '$fach_klausur', '$userid', '$modul1', '$modul2', '$modul3', '$modul4', '$modul5', '$modul6', '$modul7', '$modul8', '$modul9', '$modul10', '$modul11', '$modul12', '$modul13', '$modul14', '$modul15', '$modul16', '$modul17', '$modul18', '$modul19', '$modul20', '$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);
?>