Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[PHP] POST auf sich selbst

Empfohlene Antworten

Veröffentlicht

Hi,

eigentlich n einfaches Thema, aber irgendwie wills einfach nich klappen :(

Hab ne .php-Datei, die beinhaltet:

- ein <form> mit ein paar <input>-Feldern und als action sich selbst

- ein <?php?> mit der ausgabe dieser inputfelder

Aber wenn ich den Submitbutton klick wird die seite zwar neu aufgerufen, aber die Daten werden nicht ausgegeben...

und ich seh den fehler nicht...

<body><form action="bestellung_aufgeben.php" method="post" enctype="text/plain"> 
<table border="1">
<tr>
<td align="right">Name:</td>
<td><input type="text" name="loginname" size="10"></td>
</tr>

<tr>
<td align="right">Passwort:</td>
<td><input type="password" name="loginpw" size="10"></td>
</tr>

<tr>
<td align="right">Anzahl Artikel:</td>
<td><input type="text" name="anzahlartikel" size="10"></td>
</tr>
</table>

<br>

<input type="submit" name="go_step2" value="Go >>">
</form>
<hr>
<?php
//getestet hab ich jeweils einzeln
echo $loginname; //und
echo $_POST['$loginname'] //und
echo $_REQUEST['$loginname'];
echo $loginname; //und
echo $_POST['loginname'] //und
echo $_REQUEST['loginname']; //ging aber alles nicht
?></body>[/php]


<body><form action="test.php" method="post">
<table border="1">
<tr>
<td align="right">Name:</td>
<td><input type="text" name="loginname" size="10"></td>
</tr>

<tr>
<td align="right">Passwort:</td>
<td><input type="password" name="loginpw" size="10"></td>
</tr>

<tr>
<td align="right">Anzahl Artikel:</td>
<td><input type="text" name="anzahlartikel" size="10"></td>
</tr>
</table>

<br>

<input type="submit" name="go_step2" value="Go >>">
</form>
<hr>
<?php
//getestet hab ich jeweils einzeln

echo $_POST['loginname']; //und

?></body>
[/php]

ah, das enctype="text/plain" wars

THX!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.