Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
| Subject: | Re: FLASH: All I need is one line of code! Please help - PLEASE!!!!!!!!! |
| From: | Helen Triolo |
| Date: | Thu, 20 Apr 2000 14:21:38 +0100 |
Paul Steven wrote:
>
> Set Variable: "my_score" = 120
> Set Variable: "my_name" = Paul
> Load Variables ("http://www.clubinlondon.co.uk/scripts/test.pl", 0,
> vars=POST)
>
> I have a perl script called test.pl and a text file called scores.txt
> located on a server.
>
> I have checked all the permissions and they are all correct.
>
> All I want to do is assign the variables sent from flash to a variable in
> the perl script - please can someone tell me what this line of code is.
>
> I have tried the following but it is not working :(
>
> #!/win32app/perl/bin
>
> $data_file = "scores.txt";
>
> $my_name = param('my_name');
> $my_name = param('my_score');
>
> open (SCORES_FILE, ">$data_file");
>
> print SCORES_FILE "$my_name\n";
> print SCORES_FILE "$my_score\n";
>
> close SCORES_FILE;
>
Paul,
I'm no Perl guru (disclaimer), so I haven't seen param used to read in
variables from a form and can't comment on that. Instead, when I've
used Perl scripts that pass via POST, the input method is like this:
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs){
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
and then your variables would be referred to as
$FORM('my_name') and $FORM('my_score')
Also, I'd change the second variable assignment in Flash to
Set Variable: "my_name" = "Paul"
since it's a string variable.
Don't know if any of this will help--it's all I can come up with without
digging further.
Regards,
Helen
----------------------------------------
helen triolo � http://i-technica.com
designer
----------------------------------------
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml
Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email help
Replies
FLASH: All I need is one line of code! P, Paul Steven
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]

