Communication between 2 swf files using php

what im trying to do basically is have swf1 on computer 1 when i press a button in the swf it uses fwrite to write something into a text file. for my example lets say it wrote the number 30 into it and saved it.

now swf2 has a layer on it that runs a check of that file with php post i guess or w/e would be the most effective way to get the string from the text file from the server. it opens the file and takes 30 and makes it into a variable and w/e that variable is swf2 uses gotoAndPlay(variable);