Link to home
Start Free TrialLog in
Avatar of jerzyk
jerzyk

asked on

Document contains no data

Please help me,
I wrote a cgi:

#!/usr/bin/perl

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

#full path
$file="/home/httpd/html/dane.html";

#require cgi-lib.pl
require "cgi-lib.pl";

&ReadParse;

#otwiera plik i dostawia do niego nowe dane
open(DB,">>$file");

#drukuje informacje
print DB "\n<B>$in{'name'}<BR>";
print DB "\n$in{'location'}</B><BR>";
print DB "\n$in{'comments'}<BR><HR>\n";

close DB;

And html file:

<html>
<head>
<title>Test</title>
</head>

<form method=post action="../cgi-bin/dane.pl">
Nazwa:<input name="name"><br>
Adres:<input name="location"><br>
<BR>Komentarz:<br>
<textarea name="comments">
</textarea>
<input type="submit">
</form>

<b>Show me entries:</b>
<BR>

When I submit this form I receiving a
"Documen contains no data"
message. But when I reload form page I see new entries.
dane.pl has 755
dane.html has 666

please help me,
JerzyO.
Avatar of ozo
ozo
Flag of United States of America image

why don't you try putting some data in the document:
print "Content-type: text/html\n\n";
print qq(<html><head><title>document</title></head>\n <body>form submitted</body></html>\n);

ASKER CERTIFIED SOLUTION
Avatar of steve_howell
steve_howell

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial