Zum Inhalt springen

Probleme mit URL und Formaction

Erstellt am 25. Mai 2012 · 1 Antwort · letzte Antwort am 25. Mai 2012

Tags: Frage

lil-trick ·

Hallo,

hab eine kleine Extension gebaut - ein Formular.

Template sieht so aus:
<form action="###ACTION###" method="get" name="myform" enctype="multipart/form-data">

Marker ###ACTION### lass ich so befüllen:
$markerArray['###ACTION###'] = $this->pi_getPageLink($GLOBALS['TSFE']->id);

im Quellcode sieht das auch ganz gut aus:
<form action="index.php?id=80" method="get" name="myform" enctype="multipart/form-data">

geht man nun auf senden - erstellt er diese URL:
www.domain.de/index.php?myselect=2&mysubselect=9&absenden=suchen

er entfernt also die ID aus der URL - warum? bzw. wo liegt der Fehler?

Danke

LuP ·

Hallo,

get: With the HTTP "get" method, the form data set is appended to the URI specified by the action attribute (with a question-mark ("?" ) as separator) and this new URI is sent to the processing agent.

Ref: Form submission method @ W3C

Um die id zu erhalten, müsstest Du sie als hidden setzen und mitsenden:

<input type="hidden" name="id" value="###TARGET_PAGEID###" />
$markerArray['###TARGET_PAGEID###'] = (int)$GLOBALS['TSFE']->id;

VG,
LuP