Hallo,
danke schonmal füe die Hilfe!
Ich habe mal Dein Vorschlag versucht umzusetzen nur gelingt mir da etwas nicht. Was ist daran falsch?
Folgende Fehlermeldung bekomme ich:
Danke
__________
Notice: Use of undefined constant bericht_pdf - assumed 'bericht_pdf' in /www/affe/affe_5.php on line 70
Notice: Use of undefined constant php - assumed 'php' in /www/affe/affe_5.php on line 70
Warning: include(bericht_pdfphp) [function.include]: failed to open stream: No such file or directory in /www/affe/affe_5.php on line 70
Warning: include(bericht_pdfphp) [function.include]: failed to open stream: No such file or directory in /www/affe/affe_5.php on line 70
Warning: include() [function.include]: Failed opening 'bericht_pdfphp' for inclusion (include_path='.:/usr/share/pear/php5') in /www/affe/affe_5.php on line 7
___________
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>Bericht</title>
<meta name="keywords" content="" />
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="formular" id="formular">
<div>
<h2>Select 1</h2>
<select class="defbreite" name="Select_1" id="Select_1">
<option selected value="">Bitte auswählen! </option>
<option value="Select_A1 ">Select_A1</option>
<option value="Select_B1 ">Select_B1</option>
<option value="Select_C1 ">Select_C1</option>
</select>
</div>
<br>
<div>
<h2>Select 2</h2>
<select class="defbreite" name="Select_2" id="Select_2">
<option selected value="">Bitte auswählen! </option>
<option value="Select_A2 ">Select_A2</option>
<option value="Select_B2 ">Select_B2</option>
<option value="Select_C2 ">Select_C2</option>
</select>
</div>
<br>
<div class="knopf">
<input class="submit" type="submit" name="eintragen" id="eintragen" value="Bericht drucken"/>
</div>
</form>
</body>
</html>
<?php
error_reporting(E_ALL);
// Formulardaten einlesen
if (isset($_POST['eintragen'])) {
$errors = array();
//variablen auf inhalt prüfen und ggf. den fehler in das array $errors packen
if ($_POST['Select_1'] == '') {
$errors[] = 'Select_1';
}
if ($_POST['Select_2'] == '') {
$errors[] = 'Select_2';
}
// ist ein fehler aufgetreten?
if (count($errors) > 0) {
//wenn ja, fehler ausgeben
echo 'Sie müssen folgende Felder ausfüllen!<br />' . implode(', ', $errors);
include(affe.php);
} else {
//wenn nicht,
include(bericht_pdf.php);
}
}
?>
bericht_pdf.php
<?php
error_reporting(E_ALL);
$DATUM = $_POST['Select_1'];
$SCHICHT = $_POST['Select_2'];
$ProdNr = $_POST['Select_1'] ."-" .$_POST['Select_2'];
echo $DATUM;
echo $SCHICHT;
echo $ProdNr;
?>