simple lang po prob nyo ... walang:
print "Content-type:text/html\n\n" bago magdisplay
kaya hindi nya alam kung ano ang content-type ng
script kaya wala siya maiload ;)
RENZ
--- Glenn Remot <[EMAIL PROTECTED]> wrote: > hi
gurus!
> i hav a problem with my cgi script. when i run it
> from my browser, i get
> the Premature end of script headers: error. Below is
> the script.
> TIA and GOD bless!
>
> ###start
>
> #!/usr/bin/perl -w
> use strict;
> use CGI qw(:all);
> use Fcntl qw(:flock);
>
> #Data location
> my $data="/forms/mailproxy";
> #semaphore file
> my $semaphore_file="/forms/semaphore.smp";
>
> #Lock function
> sub get_lock {
> open(SEM, ">$semaphore_file") || die "Cannot
> create semaphore
> file: $!";
> flock SEM, LOCK_EX;
> }
>
> #Unlock funtion
> sub release_lock {
> close(SEM);
> }
>
> #Append to data file function
> sub append {
> get_lock();
> open(DT, ">>$data") || die "Cannot open
> $data: $!";
> print DT "name: " param('name'), "\n";
> print DT "position: " param('position'),
> "\n";
> close(DT);
> release_lock();
> }
>
> #Display function for minimal html formatting
> sub display {
> open(DT, "$data") || die "Cannot open $data:
> $!";
> while(<DT>) {
> print "<b>$_</b><br>";
> my($name,$position);
> $name=<DT>;
> $position=<DT>;
> print "$name<br />";
> print "$position<br />";
> }
> close(DT);
> }
>
> print header();
> if (defined param('submit')) {
> append;
> display;
> } else {
>
> ###end
>
> --
> Glenn
>
> > --
> Philippine Linux Users' Group (PLUG) Mailing List
> [EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
> Official Website: http://plug.linux.org.ph
> Searchable Archives: http://marc.free.net.ph
> .
> To leave, go to
> http://lists.q-linux.com/mailman/listinfo/plug
> .
> Are you a Linux newbie? To join the newbie list, go
> to
>
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie
=====
---------------
"C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do,
it blows away your whole leg."
- Bjarne Stroustrup (from Good Quotations compiled by Dr. Gabriel Robins)
LAWRENCE SALMINGO
---------------
________________________________________________________________________
Want to chat instantly with your online friends? Get the FREE Yahoo!
Messenger http://mail.messenger.yahoo.co.uk
--
Philippine Linux Users' Group (PLUG) Mailing List
[EMAIL PROTECTED] (#PLUG @ irc.free.net.ph)
Official Website: http://plug.linux.org.ph
Searchable Archives: http://marc.free.net.ph
.
To leave, go to http://lists.q-linux.com/mailman/listinfo/plug
.
Are you a Linux newbie? To join the newbie list, go to
http://lists.q-linux.com/mailman/listinfo/ph-linux-newbie