Thread mit html auf cgi-Skript zugreifen; Wie? (16 answers)
Opened by Duff at 2008-01-17 16:42

Duff
 2008-01-17 16:42
#104845 #104845
User since
2006-10-06
283 Artikel
BenutzerIn

user image
Hallo,

ich möchte gerne wissen, wie ich ein html und perl/cgi verknüpfen muss.
Ich habe mir auf einem linux-system apache installiert und den Dienst gestartet.

Im Verzeichnis /var/www habe ich folgende Datei erstellt:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
debian:/var/www# cat begruessung.html
<html>
<head>
  <title>Wie heist du denn?</title>
</head>
 <body>
  <form action="hello.pl" method=get>
   <input type=text name="vorname" size=30>
   <input type=submit value="Ich haben fertig!">
  </form>
 </body>
</html>


Das Skript hello.pl sieht so aus:
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
debian:/var/www# cat hello.pl
#!/usr/bin/perl -w
use strict;
my $qrystrg = $ENV{'QUERY_STRING'};
($varname, $varwert) = split(/=/, $qrystrg);

print "Content-type: text/html\n\n";
print "
<html>
 <head>
  <title>Hallo $varwert</title>
 </head>
 <body>
  <h1>Hallo $varwert</h1>
 </body>
</html>";#!/usr/bin/perl -w


Nur funktioniert die Ausführung noch nicht. Was muss ich ändern?
Habe das Skript auch schon mal nach /usr/lib/cgi-bin kopiert. Hat aber auch nichts gebracht.

Danke.
D'OH
Daniel

View full thread mit html auf cgi-Skript zugreifen; Wie?