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.

perl: prob mit param()

Empfohlene Antworten

Veröffentlicht

also ich hab folgende files

nub.pl

#!/usr/bin/perl -w


use strict;

use CGI qw(:standard);



print "Content-type: text/html";

print "<html><head><title>lolol</title></head><body>";;

print "<form method='post' action='test.pl'>";

print "<input type='text' name='name'></input>";

print "<input type='submit' value='weg damit'></input></form></body></html>";

und test.pl
#!/usr/bin/perl -w


use strict;

use CGI qw(:standard);



print "Content-type: text/html\n\n";

print "<html><head><title>test.pl</title></head><body>";

print "server name:", param('name'), "</body></html>";

wenn ich nu in der kommandozeile aufrufe: perl test.pl name=lala wird das wunderbar ausgegeben ... wenn ich nun ueber den apache das nub.pl aufrufe und da auf submit klicke, kommt ne error seite und im apache log steht:
[Thu Oct 14 16:53:03 2004] [error] 10936: ModPerl::Registry: Undefined subroutine &ModPerl::ROOT::ModPerl::Registry::info2_u01_www_cgi_2dbin_test_2epl::param called at /info2_u01/www/cgi-bin/test.pl line 10.

-------

aber wieso macht der das, wenn der doch das param() zu kennen scheint, wenn ichs direkt aufrufe? oder versteh ich da was falsch? oder bin ich einfach zu blind um nen fehler zu sehen ...

ich bin echt gleich am ende (mit den nerven) und bin fuer jede hilfe dankbar

Hi,

ich hab das daheim mal ausprobiert, bei gabs nen HTTP 500 Fehler, wenn ich dein nub.pl ausführen wollte, trage ich anstatt von


print "Content-type: text/html";

die Zeile so

print "Content-type: text/html\n\n";

ein gehts.

Vielleicht ist das irgendeine komische Einstellung von mod_perl das man diese Content-type Zeile immer mit 2 Newlines beenden muss :confused:

Weil, die ganzen Beispielen von XAMMP, im Verzeichnis cgi-bin handeln diesen Aufruf genau so.

Auf jeden Fall hat es so bei mir funktioniert.

Testkonfiguration:

Apache/2.0.50 (Win32) mod_perl/1.99_14 Perl/v5.8.4

Wünsch dir viel Erfolg :)

Grüße

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.