5 Replies Latest reply on May 2, 2006 8:49 AM by Newsgroup_User

    XML, PHP and Flash forms

    aniebel Level 2
      After searching several tutorials and forum posts, I still am puzzled at how to get started on this.

      I want to enable my client to upload changes to the XML file used on his site without knowing anything about XML. He also wants to upload images which are referenced in the XML. So, I am assuming that I create a form that allows him to type in changes to sections and select an image on his local drive and submit it to a PHP script on the server which will, in turn generate/update the XML and upload the image(s).

      Is this correct or am I going about it the wrong way? Of course, I should just tell him he'll have to pay me to update the site. ;-) I'm really confused about how to start this whole thing in the planning stage. I just need a little direction then I can research the rest.

      thanks!
        • 1. Re: XML, PHP and Flash forms
          Level 7
          aniebel wrote:
          > After searching several tutorials and forum posts, I still am puzzled at how to
          > get started on this.
          >
          > I want to enable my client to upload changes to the XML file used on his site
          > without knowing anything about XML. He also wants to upload images which are
          > referenced in the XML. So, I am assuming that I create a form that allows him
          > to type in changes to sections and select an image on his local drive and
          > submit it to a PHP script on the server which will, in turn generate/update the
          > XML and upload the image(s).
          >
          > Is this correct or am I going about it the wrong way?
          >
          yes, that is exactly correct. However, it may end up being cheaper for
          him to pay you to update the site than it is to program all of that -
          really depends on how often it's likely to change!
          There's also the possible issue of your client uploading the image in
          the wrong format, or not compressing it down to a suitable level for web
          delivery - quite a few things can go wrong there really.
          --
          MOLOKO
          Macromedia Certified Flash MX 2004 Developer
          Macromedia Certified Flash MX Developer
          ------------------------------------------------
          ::remove _underwear_ to reply::
          'There ain't no devil - it's just God when he's drunk' Tom Waits
          ------------------------------------------------
          GCM/CS/IT/MC d-- S++:- a- C++ U--- P+ L++ !E W+++$ N++ O? K+ w+++$ !O M+
          VMS? PS+++ PE- Y PGP+ t+ 5-- X-- R* tv++ b++++ DI++++ D+ G e h-- r+ y++
          • 2. Re: XML, PHP and Flash forms
            aniebel Level 2
            Thanks, unfortunately I've alredy committed to this. I'm actually paring it down since he also wanted to upload MP3s and video.

            So, do I make fields (variables) for each node in the XML? And can I use any PHP script that converts my loadvars to XML? I'm not sure what to search for, specifically. I hope I'm not in over my head but it seems getting into these predicaments is a great way to learn.
            • 3. Re: XML, PHP and Flash forms
              Level 7
              aniebel wrote:
              > So, do I make fields (variables) for each node in the XML? And can I use any
              > PHP script that converts my loadvars to XML? I'm not sure what to search for,
              > specifically. I hope I'm not in over my head but it seems getting into these
              > predicaments is a great way to learn.
              >
              are you making this admin interface in flash then? personally I would
              steer clear of that as it will be harder to debug - doing it in HTML
              will be much more straightforward, and if you do it right you can change
              to using a flash front end in future.

              Handling file uploads in PHP is a little tricky but there are loads of
              good pages of advice on using PHP on the web. Here's a good place to
              start as there's lots of notes by other users:
              http://us2.php.net/manual/en/function.is-uploaded-file.php

              XML with PHP I have only done once - and I think that was just reading
              it and not writing it. Should be OK though, again, lots of help
              available online!

              --
              MOLOKO
              Macromedia Certified Flash MX 2004 Developer
              Macromedia Certified Flash MX Developer
              ------------------------------------------------
              ::remove _underwear_ to reply::
              'There ain't no devil - it's just God when he's drunk' Tom Waits
              ------------------------------------------------
              GCM/CS/IT/MC d-- S++:- a- C++ U--- P+ L++ !E W+++$ N++ O? K+ w+++$ !O M+
              VMS? PS+++ PE- Y PGP+ t+ 5-- X-- R* tv++ b++++ DI++++ D+ G e h-- r+ y++
              • 4. Re: XML, PHP and Flash forms
                aniebel Level 2
                Thanks, I think that HTML idea is the piece that I was missing. Sometimes it's the easier things one overlooks.

                Thank you, thank you, thank you!
                • 5. Re: XML, PHP and Flash forms
                  Level 7
                  aniebel wrote:
                  > Thanks, I think that HTML idea is the piece that I was missing. Sometimes it's the easier things one overlooks.
                  >
                  > Thank you, thank you, thank you!

                  It will be much easier as when things go wrong you'll get much more
                  feedback from PHP. When you do flash->PHP you don't get any error
                  messages as PHP's errors are generally sent as HTML - which isn't much
                  usde to flash which expects name=value pairs or XML when communicating
                  with server-side code. Even if you use some form of flash remoting (e.g.
                  AMFPHP) it's still pretty tough to debug when things go wrong.

                  Even if I am working Flash->PHP->Flash, I will generally set up
                  everything as very rough HTML first, then when I've got that working
                  I'll move to doing it in Flash. At that point I'll generally have
                  written quite a a lot of error handling into my PHP and any further
                  debugging can be done using an HTTP sniffing tool such as
                  http://apps.mkulu.org/qaproxy/

                  --
                  MOLOKO
                  Macromedia Certified Flash MX 2004 Developer
                  Macromedia Certified Flash MX Developer
                  ------------------------------------------------
                  ::remove _underwear_ to reply::
                  'There ain't no devil - it's just God when he's drunk' Tom Waits
                  ------------------------------------------------
                  GCM/CS/IT/MC d-- S++:- a- C++ U--- P+ L++ !E W+++$ N++ O? K+ w+++$ !O M+
                  VMS? PS+++ PE- Y PGP+ t+ 5-- X-- R* tv++ b++++ DI++++ D+ G e h-- r+ y++