Posted by alexjaquet on 04/17/06 22:32
Hi,
I'm new to php and I'm trying to translate the following code :
sub loadPreferencesAuto {
local our $content;
open (FILE, "<$dir/preferences_auto.html") or die "cannot open file
$dir/preferences_auto.html";
while (<FILE>) {
s/\$LABEL{'([\w]+)'}/ exists $SERVER{$1} ? $SERVER{$1} : $1 /eg;
s/\$LANG/$lang/g;
s/\$ERROR{'([\w]+)'}//g;
s/\$SESSIONID/$session_id/g;
$content .= $_;
}
$content = Compress::Zlib::memGzip($content) if $can_do_gzip; ;
print "Content-Length: ", length($content) , "\n";
print "Content-Encoding: gzip\n" ;
print "Content-Type: text/html\n\n";
print $content;
close (FILE);
}
[Back to original message]
|