#!/usr/bin/perl # # flashupdate.pl # by teabag last rev. 09/04/03 # This Perl script create Flash variables and write them # to an text file, which you can load into your flash site. ################################################################# # Instructions # 1. Define the 3 variables # 2. Upload update.pl script to your /cgi-bin or (cgi)folder # using ASCII mode and CHMOD 755 # 3. Upload an empty (.txt) file named to the path (../data)you specify # in $full_path # 4. Run and RESET/DELETE the script by calling it from an HTML form of from a # Flash-generated form (using Get URL, with option Variables: Send using POST) ################################################################# # Define these variables! # relative path form script to dir where datafile is located # no trailing slash! # added just a simple fixed ip-numbercheck $myipnumber = "123.45.67.890"; $full_path = "/htdocs/data"; $data_file = "update.txt"; checkip(); @days = ('Sunday','Monday','Tuesday','Wednesday', 'Thursday','Friday','Saturday'); @months = ('january','february','march','april','may','june','july', 'august','september','october','november','december'); ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900; $date_for_logfile = "$mday $months[$mon] $year, $time"; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name,$value)=split(/=/,$pair); $name =~tr/+//; $name =~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; $value =~tr/+//; $value =~ s/~!/ ~!/g; $value =~ s/\+/ /g; $value =~ s/<([^>])*>//g; $value =~ s/(\r)+/\-\-/g; $value =~ s/\n+//g; $value=~s/\