LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 09-13-2003, 01:38 PM
help-me-pls help-me-pls is offline
Registered User
 
Join Date: Sep 2003
Posts: 1
Rep Power: 0
help-me-pls is on a distinguished road
Crying flash highscore board (windows perl)

Hi,

I have downloaded a flash game which has a perl highscore board. This is how i think it works the flash file calls the perl script which then writes the score and scorers name to a text file, then the text file is loaded into the swf.

This all worked perfectly on the unix space i had but now I only have windows space. My hosts have run a piece of perl on my windows 2000 IIS 5 server to show that perl is supported but the perl i am using doesnt work because it was written for a unix server. Does anybody know how to change the perl i have got so it will work, or another method of getting my highscore board up and running (asp is supported but php isn't)?

unfortunatley i cant cancel my windows hosting and go back to unix, because i would have to rebuy my domain name and my hosts wont refund the money because their perl works.

This is the flash code:
Code:
//scoresURL = "scores.txt";
scoresURL = "http://www.mysite.com/cgi-bin/scores.pl";

if (score) {
	stop();
	pos = Selection.getCaretIndex();
	if (pos == -1) Selection.setFocus("newName");
}
else nextFrame();
This is the perl:
Code:
#!/usr/bin/perl

$hsfile = "$hsfile = "scores.txt";
# CHMOD this to 666 and this perl script to 755

print "Cache-Control: max-age=0, must-revalidate\n";
print "Expires: Sun, 31 Oct 2001 12:00:00 GMT\n";
print "Content-Type: text/plain\n\n";

# Read input from POST http header into buffer
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
$len = length($buffer);

if ($len > 12) {
	@pairs = split(/&/, $buffer);
	foreach $pair (@pairs) {
	        ($nm, $val) = split(/=/, $pair);
	        $NEWDATA{$nm} = $val;
	}

	open (FILE,"<$hsfile");
	flock (FILE,2);
	$line = <FILE>;

	$count = 0;
	$newline = "";
	$ranked = 0;
	@pairs = split(/&/, $line);
	foreach $pair (@pairs) {
		if ($count < 101) {
			($nm, $val) = split(/=/, $pair);
			if (substr($nm,0,4) eq "name") {
				$newline .= "name$count=$val&";
			}
			else {
				if ($ranked == 0 && $NEWDATA{'score'} > $val && $NEWDATA{'name'} ne "") {
					$count++;
					$newline .= "score$count=$NEWDATA{'score'}&name$count=$NEWDATA{'name'}&";
						$ranked = 1;
				}
	
				$count++;
				$newline .= "score$count=$val&";
			}
		}
	}
	print $newline;
	close (FILE);

	$lennew = length($newline);
	if ($lennew > 12) {
		open (FILE,">$hsfile");
		flock (FILE,2);
		print FILE "$newline";
		close (FILE);
	}
}
else {
	open (FILE,"<$hsfile");
	flock (FILE,2);
	$line = <FILE>;
	print "$line";
	close (FILE);
}
The text file looks like this:
Code:
score1=10&name1=DAVE
If anyone can help (even just a little bit), i would be so so so so grateful.
Attached Files
File Type: zip scores.zip (746 Bytes, 3 views)
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with flash videos with Windows 2000 and I.E. 6 jackan Flash CS3 / Flash 9 1 01-30-2008 08:56 AM
Ctr Pop Up HTML Windows using 'Flash 8' Player Insomniis Flash 8 2 09-11-2006 05:57 PM
Flash Video MX 1.8.15 released gooogle New Softwares 2 06-01-2006 07:57 AM
Hi, Kind of a Newbie question about windows in flash! NBKNAS Flash MX 2 08-22-2005 03:17 PM
Is Windows just superior to Mac for playing .flv? karma-lab Flash Video 0 08-07-2005 09:36 PM




All times are GMT. The time now is 09:35 PM.