Schrift
[thread]905[/thread]

Probleme mit GET POST

Leser: 1


<< >> 4 Einträge, 1 Seite
Gast Gast
 2007-03-15 22:08
#9821 #9821
Hallo Forum,
ich bin noch nicht sehr lange in Perl aktiv und habe daher ein Problem.

Ich habe ein einfaches html Formular, welches per Post abgeschickt wird.

Die Werte für das Formular hole ich mir über das cgi Modul, sprich:
my $name=$cgi->param('name');

Nun zu meinem Problem:
Ich möchte im <form action attribut eine Variable per GET übertragen, was leider nicht geht.

also bei <form action="index.pl?variable=test" kommt diese Variable nicht an. Die Post Variablen sind da.

Hat jemand eine Idee woran das liegt?

viele grüße und dank,
Holi\n\n

<!--EDIT|GwenDragon|1173989539-->
GwenDragon
 2007-03-15 22:15
#9822 #9822
User since
2005-01-17
14598 Artikel
Admin1
[Homepage]
user image
Quote
MIXING POST AND URL PARAMETERS
$color = $query->url_param('color');

It is possible for a script to receive CGI parameters in the URL as well as in the fill-out form by creating a form that POSTs to a URL containing a query string (a "?" mark followed by arguments). The param() method will always return the contents of the POSTed fill-out form, ignoring the URL's query string. To retrieve URL parameters, call the url_param() method. Use it in the same way as param(). The main difference is that it allows you to read the parameters, but not set them.

Under no circumstances will the contents of the URL query string interfere with similarly-named CGI parameters in POSTed forms. If you try to mix a URL query string with a form submitted with the GET method, the results will not be what you expect


Code: (dl )
 $color = $cgi->url_param('name');
Gast Gast
 2007-03-15 23:00
#9823 #9823
Nur ein dickes Dankeschön für die Rasche Hilfe.

Leider klappt das nicht mit der Registrierung, so muss ich hier antworten.

Nochmal vielen Dank,
Holi
betterworld
 2007-03-15 23:14
#9824 #9824
User since
2003-08-21
2613 Artikel
ModeratorIn

user image
Ich habe mal die Threads verbunden. Das alte Subject des letzten Beitrags von Hannes 65 war: "@ GWENDRAGON".
<< >> 4 Einträge, 1 Seite



View all threads created 2007-03-15 22:08.