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.

Unbekannte Post Variabeln

Empfohlene Antworten

Veröffentlicht

Hallo,

wie kann man in einem PHP Script alle Variabeln ausgeben die vorher durch ein HTML Form gepostet wurden, ohne die Elementnamen der Input bzw. Selectfelder zu kennen?

Problem ist, das Form ist nicht von mir und ändert sich sehr häufig.

die PHP Seite sollte erstmal einfach alles anzeigen was das Form wegschickt.

Die restlichen Aufgaben kann ich danach selbst lösen.

Hat jemand eine Idee??

Danke!

Gruß Scratch

Jo, das funktioniert nicht, weil die Array-Schlüssel nicht numerisch sind, sondern Deinen Feldnamen entsprechen...


foreach ($_POST as $key=>$val) {

  echo 'Feldname: '.$key.'; Wert: '.$val.'<br>';

}

Edit: Und zum einfachen Anzeigen der übermittelten Werte (mit $_REQUEST, da unabhängig von GET/POST):

echo '<pre>';

print_r($_REQUEST);

echo '</pre>';

Verwende $_POST nicht die veralteten $HTTP_POST_VARS !

$_POST und $HTTP_POST_VAR ist das gleiche...

$_POST ist nur neuer...

$_POST und $HTTP_POST_VAR ist das gleiche...

$_POST ist nur neuer...

Ich habe nichts anderes behauptet...

Wobei es ratsamer ist, die Kurzform zu verwenden, da sich die lang-namigen Variablen seit PHP 5 in der Konfiguration deaktivieren lassen...

AFAIK lassen sich diese auch schon in PHP4 deaktivieren, nur in PHP5 sind sie default deaktiviert...

Also laut Doku geht's erst ab PHP-5:

As of PHP 5.0.0, the long PHP predefined variable arrays may be disabled with the register_long_arrays directive.

Seit PHP 5.0.0 können Sie die Registrierung der langen von PHP vordefinierten Arrays mit der Konfigurationsoption register_long_arrays abschalten.

Ich nehme alles zurück und behaupte das Gegenteil :-|

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.