Ich habe folgendes Script zur Eingabe in ein Formularfeld geschrieben (eingabe_post.html), um die Eingabe an ein php-script (ausgabe_post.php) zu übergeben. Mit der GET-Methode funktioniert das einwandfrei, bei POST kommt nichts an.
eingabe_post.html:
- Code: Select all
<html>
<head>
<meta content='text/html; charset=ISO-8859-1' http-equiv='content-type'>
<title>Eingabe_post</title>
</head>
<body>
<form enctype='text/plain' method='post' action='ausgabe_post.php' name='frm_eingabe_post' >
<table >
<tr>
<td>Eingabe:</td>
<td><input type='text' name='eingabe' size='10' maxlength='15'/></td>
</tr>
</table>
<p><input value='Abschicken' type='submit'></p>
</form>
</body>
</html>
ausgabe_post.php:
- Code: Select all
<?php
error_reporting(E_ALL);
header('Cache-Control: no-cache, must-revalidate');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Ausgabe (post)</title>
</head>
<body>
<?php
echo 'die Eingabe war: ';
echo $_POST['eingabe'];
?>
</body>
</html>
Das Ergebnis sieht so aus:
die Eingabe war:
Notice: Undefined index: eingabe in C:\xampp\htdocs\Versuche\ausgabe_post.php on line 14
Wo liegt mein Fehler?