[swx] storing swx file on server

Folkert Hielema nederflash at gmail.com
Tue Sep 25 08:55:30 PDT 2007


In the last message on the list there is how you save a file with php.

Basicly what you do is write yourself a class with the methods you need. The
class you can decide to connect to the db or to a text file.
 A simple (not tested out of the head ;)) class would be something like this

class YourDataService
{
      function YourDataService()
      {
          //here you connect to the db and select the db you want to use
      }

      function saveMessage($says, $user ="NONE")
        {
            //do data validation so your not supprised with attacks of any
kind
//if data is not good return 'false' else insert it to the db
            $result = mysql_query("INSERT INTO yourTable(id, user, message)
VALUES ('','".$user."','".$says."')");

            if($result)
            {
                return true;
            }else
            {
                return false;
            }
        }
}

That is in shorts ;)

good luck,

Folkert
On 9/25/07, Andrew Sinning <andrew at learningware.com> wrote:
>
> I learned about swx at our local Flash users' group last week.  I'm
> really excited about using it.  I am quite sure that I don't fully
> understand all of its power, as I've never used any of the tools that
> it's being compared to.  I've always just used LoadVars and xml.
>
> The example in the tutorial shows how to get data from a server to a
> Flash movie using SWX PHP.  I would like to create the data in a Flash
> movie, post it to the server, store it on the server, either as a raw
> text file or in a db, and then later serve the swx back to a different
> Flash movie.
>
> How would I do this using SWX PHP?
>
> Thanks!
>
>
> _______________________________________________
> swx mailing list
> swx at osflash.org
> http://osflash.org/mailman/listinfo/swx_osflash.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/swx_osflash.org/attachments/20070925/fea4d91d/attachment.html 


More information about the swx mailing list