Hello! I'm a crossword maker, and I don't know php at all....:o I have two .pl scripts, but since my server doesn't support Perl, I would like to convert them to php?
Would this be possible? Easy? Hard? The scripts are supposed to save/load your progress while solving my crosswords (java applet).
Below are the scripts. 1st script saves the progress in a html-file, 2nd script loads the html-file. Immensely thankful for any help!
// Marvin
Script 1 (saveme.pl)
#!/usr/local/bin/perl
$sol = $ENV{'QUERY_STRING'};
$sol =~ tr/+/ /;
$sol =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
print "Content-type: text/html\n\n";
print <<EOM;
<html>
<head>
<title>Save Crossword Solution</title>
</head>
<body bgcolor="#FFFFFF" link="#0000FF" vlink="#800080">
<H2> Save Crossword </H2>
To save your progress with the crossword save this page to your hard disk.
Then when you want to continue solving open the page and go to your<P>
<A HREF="$sol">Saved Puzzle</A>.
<P>
Alternatively you can click on the link now and bookmark the page.<P>
On some browsers you may need to press Reload/Refresh after
following the link.
</HTML>
EOM
exit;
Script 2 (showpuz.pl)
#!/usr/local/bin/perl
$parm = $ENV{'QUERY_STRING'};
print "Content-type: text/html\n\n";
($file,$sol) = split(/\?/,$parm);
if ($file =~ m/.htm/m) {
open(HTML, $file);
@buffer = <HTML>;
close HTML;
$buffer = join('',@buffer);
($start,$end) = split ('<!--\[CCPROGRESS\]-->', $buffer);
print "$start";
if ($sol ne "") {print "<PARAM NAME='PROGRESS' VALUE='$sol'>";}
print "$end";
} else {
print "Must be a .htm or .html file";
}