___________Saving/Loading variables with PHP

Hi there,

I’m trying to save a change to a text document (In this case a variable “Title” just to test) and then view the changes from another swf movie…

In the end I’m hoping to build a client updatable flash site. In particular menu items… feature items & prices.

A Recap: a client types in the items, php/flash saves the changes to the text document, and site visitors can views those changes.

Something in my code isn’t clicking:

My PHP is:

   $Title = $_POST['Title'];
   $toSave = "Title=".$Title;
   //Open a file in write mode
   $fp = fopen("content.txt", "w");
   if(fwrite($fp, $toSave)) echo "writing=Ok";
   else echo "writing=Error";

My ActionScript is

submit.onPress = function(){
myData.Title = Title.text
myData.sendAndLoad("save.php", myData, "POST")
myData = new LoadVars()
myData.onLoad = function(){
if(this.writing=="Ok") {
status.text = "Submited data was saved"
else status.text = "Error in saving submitted data"

I’ve been told to try more simple code like


But I’m not sure where to put it?!

  • B