I'm trying to integrate FCKEditor into a perl website.
I can get the editor to appear just fine. The problem is getting the information on the next page in the post variables. I instantiate the editor with:
var oFCKeditor = new FCKeditor( 'DESC' ) ;
oFCKeditor.Create() ;
However the DESC variable in the post variables is empty. I use this function to grab all the post variables in put them into a $form variable.
#-#############################################
# Sub: Get Form Data
# This gets data from a post.
sub get_form_data {
my $temp;
my $buffer;
my @data;
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
foreach $temp (split(/&|=/,$buffer)) {
$temp =~ tr/+/ /;
$temp =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
$temp =~ s/[\r\n]/ /g;
push @data, $temp;
}
foreach $temp (split(/&|=/,$ENV{'QUERY_STRING'})) {
$temp =~ tr/+/ /;
$temp =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
$temp =~ s/[\r\n]/ /g;
push @data, $temp;
}
return @data;
}
But when I do:
print ($form{'DESC'});
Nothing appears. It's a little maddening. Oh and by the way, it's an apache server running perl. Anyone have an answer?
I can get the editor to appear just fine. The problem is getting the information on the next page in the post variables. I instantiate the editor with:
var oFCKeditor = new FCKeditor( 'DESC' ) ;
oFCKeditor.Create() ;
However the DESC variable in the post variables is empty. I use this function to grab all the post variables in put them into a $form variable.
#-#############################################
# Sub: Get Form Data
# This gets data from a post.
sub get_form_data {
my $temp;
my $buffer;
my @data;
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
foreach $temp (split(/&|=/,$buffer)) {
$temp =~ tr/+/ /;
$temp =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
$temp =~ s/[\r\n]/ /g;
push @data, $temp;
}
foreach $temp (split(/&|=/,$ENV{'QUERY_STRING'})) {
$temp =~ tr/+/ /;
$temp =~ s/%([0-9a-fA-F]{2})/pack("c",hex($1))/ge;
$temp =~ s/[\r\n]/ /g;
push @data, $temp;
}
return @data;
}
But when I do:
print ($form{'DESC'});
Nothing appears. It's a little maddening. Oh and by the way, it's an apache server running perl. Anyone have an answer?
RE: Can't get FCKEditor to work with Perl
Try:
----------------------
#!/usr/bin/perl
use CGI;
$cgi = new CGI;
print $cgi->param{'DESC'};
----------------------
Don't forgot that you will need to output the HTML headers prior to printing anything back to the browser window.
e.g. print "Content-type: text/html\n\n";