Schrift
Wiki:Tipp zum Debugging: use Data::Dumper; local $Data::Dumper::Useqq = 1; print Dumper \@var;
[thread]249[/thread]

Save.pl Speichert nicht mehr ab !! (Seite 2)



<< |< 1 2 >| >> 16 Einträge, 2 Seiten
Ronnie
 2004-05-03 18:28
#2338 #2338
User since
2003-08-14
2022 Artikel
BenutzerIn
[default_avatar]
[quote=visual,03.05.2004, 15:05]Das Problem ist, dass das Script was in die Datei schreibt, leerzeichen und nicht die Daten die im Inputfeld standen ![/quote]
Hmm, poste auch mal die Html-datei mit dem Formular!
visual
 2004-05-03 19:30
#2339 #2339
User since
2004-05-03
7 Artikel
BenutzerIn
[default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<style>
.Arrows     {  font-weight:800; font-size:6pt; color:F77633 }

.Matches     {  width: 150px; font-weight:900; font-size:25pt; color:F77633; position:absolute; top:170px; left:328px; width:250px }

.Firstname      { background-color: 򽳪 width: 150px;font-familiy:Avantgarde, Arial; font-size:7pt; color:FFFFCC }

.name      { background-color: #7E7750; width: 150px; font-familiy:Avantgarde, Arial; font-size:7pt; color:FFFFCC }

.name01      { background-color: #C7739F; width: 150px; font-familiy:Avantgarde, Arial; font-size:8pt; color:FFFFCC }

.name00      { background-color: #C77A96; width: 150px; font-familiy:Avantgarde, Arial; font-size:8pt; color:FFFFCC }

.Search      { color:򽳪 font-weight:bold; font-family: Arial; font-size:8pt;
position:absolute; top:245px; left:630px; width:130px }

.Headline { font-family:Arial; font-size:12pt; color:FF6633; filter:Glow(color=#FFFFCC, strength=1) }

.Marquee {  color:#FFFFCC; font-weight:100; font-family:Arial; font-size:8pt; position:absolute; top:5px; left:0px; width:766px; filter:Glow(color=#FF5522, strength=4); text-indent:1.5mm; word-spacing:8mm }
<script language="JavaScript" src="JavaScript/search.js" type="text/javascript">
</style>
</script>


<TITLE>visualVIBES bioNET</TITLE>

</head>
<body  background="GIF01/tribal.gif " style="background-attachment:scroll" bgColor=#BEB47D>
<form id="theForm" action="/cgi-bin/save.pl" method=post">

<input style="position:absolute; top:220px; left:470px; width:130px" type="submit" class="Search" style="width:180px; height:20px;" value="save">



<input style="position:absolute; top:185px; left:10px; width:90px" class="Name01" name="Name" type="text" width=40 size="20">
<input style="position:absolute; top:185px; left:105px; width:90px" class="Name00" name="Firstname" type="text" width=40>
<input style="position:absolute; top:185px; left:200px; width:130px"class="Name01" name="Street" type="text" width=40>
<input style="position:absolute; top:185px; left:335px; width:30px" class="Name00" name="Nr" type="text" width=40 size="5">
<input style="position:absolute; top:185px; left:370px; width:50px" class="Name01" name="Code" type="text" width=40 size="5">
<input style="position:absolute; top:185px; left:425px; width:75px" class="Name00" name="City" type="text" width=40>
<input style="position:absolute; top:185px; left:505px; width:120px" class="Name01" name="Tel" type="text" width=40>
<input style="position:absolute; top:185px; left:630px; width:130px" class="Name00" name="Email" type="text" width=40>
</form>

<object id="Address" classid="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83" codebase="(Empty Reference!)">
<!--
<param name="DataURL" value="data.txt">
<param name="UseHeader" value="true">
<param name="FieldDelim" value="|">
<param name="Filter" value="">
<param name="CaseSensitive" value="false">
-->
<param name="DataURL" value="TXT/data.txt">
<param name="UseHeader" value="true">
<param name="FieldDelim" value="|">
<param name="Filter" value="">
<param name="CaseSensitive" value="false">
</object>
<hr style="position:absolute; top:19px; left:0px; width:766px"color=#FF8C00 size="1" width="750">
<hr style="position:absolute; top:96px; left:0px; width:766px"color=#FF8C00 size="1" width="750">
<hr style="position:absolute; top:98px; left:0px; width:766px"color=#FF8C00 size="1" width="750">
<img src="JPG01/0.jpg" width="766" height="76" border="0" style="position:absolute; top:20px; left:0px">
<img src="JPG01/s.jpg" width="70" height="70" border="0" style="position:absolute; top:25px; left:300px;filter:Alpha(opacity=70, finishopacity=0 , style=2">

<form name="Userinput" style="position:absolute; top:-10px; left:0px; width:130px">
<input style="position:absolute; top:230px; left:10px; width:130px" class ="Firstname" name="SearchName" type="text" width=40>
<input style="position:absolute; top:230px;left:150px; width:150px"class="name" name="SearchFirstname" type="text" width=40>
<input style="position:absolute; top:230px;left:320px; width:150px"type="button" class="Search" style="width:150px; height:20px;" value="search" onClick="Search();window.setTimeout('ersetzenMaillink()',600)">

<hr style="position:absolute; top:192px; left:0px; width:766px"color=FFA500 size="1" width="750">
<hr style="position:absolute; top:220px; left:0px; width:766px"color=F09700 size="1" width="750">
<hr style="position:absolute; top:222px; left:0px; width:766px"color=FF6633 size="1" width="750">
<hr style="position:absolute; top:256px; left:0px; width:766px"color=FF6633 size="1" width="750">
<hr style="position:absolute; top:258px; left:0px; width:766px"color=FF8C00 size="1" width="750">
<hr style="position:absolute; top:260px; left:0px; width:766px"color=FFA500 size="1" width="750">
</form>

<span id="Match" style="font-family:Arial; font-weight:900; font-size:50pt; color:CC5656; position:absolute; top:120px; left:250px; width:500px; filter:Glow(color=#FF5522, strength=10); text-indent:1.5mm;   line-height:65pt; ">
</span>





<form name="Headline_Show" style="position:absolute; top:260px; left:0px; width:130px">
<!-- Table headline start -->    

<table style=margin-left:10px; style=border-style:dashed; style=border-width:0.01cm style=border-color:FF6633 width="748">


<tr>                                                                          
<td width=125 class="Headline"><b>Name</b></td>
<td width=100 class="Headline"><b>Firstname</b></td>
<td width=80 class="Headline"><b>Street</b></td>
<td width=50 class="Headline"><b>Nr</b></td>
<td width=60 class="Headline"><b>Code</b></td>
<td width=6></td>
<td width=60 class="Headline"><b>City</b></td>
<td width=160 class="Headline"><b>Tel</b></td>
<td width=5></td>
<td width=80 class="Headline"><b>eMail</b></td>
</tr>
</table><!-- Table headline end -->
<!-- Table Entries start -->
<table style="margin-left:10px; line-height:7pt" id="Show" datasrc="#Address" style="display:none"  width="749">
<tr>
<td width=125 style="font-family:Arial; font-size:8pt;color:FF4500"><span datafld="Name"></span></td>
<td width=105 style="font-family:Arial; font-size:8pt;color:FF7200"><span datafld="Firstname"></span></td>
<td width=75 style="font-family:Arial; font-size:8pt;color:FF8600"><span datafld="Street"></span></td>
<!-- text-align:left / center / right / justify -->
<td width=53 style="font-family:Arial; font-size:8pt;color:E9C100"><span datafld="Nr"></span></td>
<td width=60 style="font-family:Arial; font-size:8pt;color:E9C100"><span datafld="Code"></span></td>
<td width=6></td>
<td width=60 style="font-family:Arial; font-size:8pt;color:F0C80A"><span datafld="City"></span></td>
<td width=63 style="font-family:Arial; font-size:8pt; color:FFD700"><span datafld="Tel"></span></td>
<td width=5></td>
<td align=center width=166 style="font-family:Arial; white-space:pre; font-size:8pt;color:FFD700"><a name="mail" href=""><span id="EMAIL" datafld="eMails"></span></a>
</td>
</tr>
</table><!-- Table Entries end -->
<!-- Table baseline start -->
<table style=margin-left:0px id="Line"  width="762">
<tr>
<td width=762 style="font-family:Arial; font-size:7pt; color:FF6633" colspan="1">
<hr color=FF6633 size="1" width="760" align="center">
</td>
</tr>
</table><!-- Table baseline start -->

<!-- Show previous and next Table entries start -->
<input class="Arrows" style="position:absolute; left:720px" type=button value=" &lt; " onclick="document.all.Show.previousPage();">

<input class="Arrows" style="position:absolute; left:745px" type=button value=" &gt; " onclick="document.all.Show.nextPage();">
<!-- Show previous and next Table entries end -->
</form>

<!-- Time -->
</body>
</html>


Die Daten Datei sieht so aus:
Name|Firstname|Street|Nr|etc.. <-- das steht inder ersten Zeile und dann kommen die Datensätze

edit renee: ne Runde [code]-Tags spendiert...\n\n

<!--EDIT|renee|1083598727-->
Ronnie
 2004-05-03 20:43
#2340 #2340
User since
2003-08-14
2022 Artikel
BenutzerIn
[default_avatar]
Du solltest Inhalt und Darstellung mit CSS sauberer trennen. Das ganze mal inhaltlich vereinfacht:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
<form id="theForm" action="/cgi-bin/save.pl" method=post">
<input type="submit" value="save" />
 <input name="Name"      type="text" width=40 size="20" />
 <input name="Firstname" type="text" width=40 />
 <input name="Street"    type="text" width=40 />
 <input name="Nr"        type="text" width=40 size="5" />
 <input name="Code"      type="text" width=40 size="5" />
 <input name="City"      type="text" width=40 />
 <input name="Tel"       type="text" width=40 />
 <input name="Email"     type="text" width=40 />
</form>

Und hier der angepasste und gesäuberte Code:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/perl

use strict;
use warnings;
use CGI;
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);

my $q = new CGI;
my $name        = $q->param("Name")         || '';
my $firstname   = $q->param("Firstname")    || '';
my $street      = $q->param("Street")       || '';
my $nr          = $q->param("Nr")           || '';
my $code        = $q->param("Code")         || '';
my $city        = $q->param("City")         || '';
my $tel         = $q->param("Tel")          || '';
my $email       = $q->param("Email")        || '';

open(COMMENTS, ">>data.txt")
 or die "Open data.txt for concat failed: $!";

print COMMENTS join("|", ($name, $firstname, $street, $nr,
                         $code, $city, $tel, $email)), "\n";

close (COMMENTS);

#
# ouput to browser
#

print $q->header,
     $q->start_html('visualVIBES bioNET'),
     $q->h1('Your entry has been saved'),
     $q->hr,
     $q->end_html, "\n";
visual
 2004-05-03 20:55
#2341 #2341
User since
2004-05-03
7 Artikel
BenutzerIn
[default_avatar]
Hi !
Html übersichtlicher gestalten ?

Vielen Dank für den Code ! Ich probiere ihn aus !
visual
 2004-05-04 00:27
#2342 #2342
User since
2004-05-03
7 Artikel
BenutzerIn
[default_avatar]
Hallo !

Danke für das Script !
Es funktioniert !
Strat
 2004-05-04 01:24
#2343 #2343
User since
2003-08-04
5246 Artikel
ModeratorIn
[Homepage] [default_avatar]
wofuer brauchst du eigentlich
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
read(STDIN, $Daten, $ENV{'CONTENT_LENGTH'});

$Daten =~ s/%3E/\>\;/g;
$Daten =~ s/%3C/\<\;/g;
$Daten =~ tr/&=+/| -/;
$Daten =~ s/Name/\ \;/g;
$Daten =~ s/Firstname/\ \;/g;
$Daten =~ s/Street/\ \;/g;
$Daten =~ s/Nr/\ \;/g;
$Daten =~ s/%2F/\/\;/g;
$Daten =~ s/Code/\ \;/g;
$Daten =~ s/City/\ \;/g;
$Daten =~ s/Tel/\ \;/g;
$Daten =~ s/Email/\ \;/g;
$Daten =~ tr/;/ /;

$Daten =~ s/[ ]| //gi;
#$Daten =~ s/+/\-\;/g;

?
CGI-Parameter kann man sehr einfach und sicher auf die folgenden Arten auslesen und konvertieren:
Code: (dl )
1
2
3
4
5
6
7
8
#! /usr/bin/perl
use warnings;
use strict;
use CGI;

my $cgi = CGI->new();
my %params = $cgi->Vars(); # als Hash
my $name = $cgi->param('name'); # oder nur einen einzelnen wert
perl -le "s::*erlco'unaty.'.dk':e,y;*kn:ai;penmic;;print"
http://www.fabiani.net/
<< |< 1 2 >| >> 16 Einträge, 2 Seiten



View all threads created 2004-05-03 16:52.