Click here to get back home

PHP and Flash

 HomeNewsGroups | Search

get this group's latest topics as an RSS feed  comp.lang.php - PHP programming language discussions

please rate
this thread
If you were  Registered and logged in, you could reply and use other advanced thread options
Posted by Tom Jordan on January 4, 2005, 7:19 am
Hi everyone,

I hope someone can shed some light on this for me!

I've just migrated a clients website over to our server. The site's
done completely in Flash, but uses a little PHP include to pull
various images from a folder and display them in the Flash movie.

Ok, this works fine on the old host, but I can't get it to work for
the life of me on my server. I've included the PHP script below. Any
feedback would be very much appreciated as I'm pulling my hair out a
bit now!

Thanks in advance,

Tom


snip ---------

<?php
function getFileStructure($doc, $curNode, $inDir){
 //echo ("get file structure ");
 if ($currentDirectory = opendir($inDir)){
  while ($dirElement = readdir($currentDirectory)){
          $pathToElement = $inDir . "/" . $dirElement;
          if (is_file($pathToElement)){
    $dotposition = strpos($dirElement, ".");
    $fileName = substr($dirElement, 0, $dotposition);
    $extension = substr($dirElement, 1 + $dotposition);
    if ($extension == "jpg" or $extension == "JPG"){
            $fileNode = addFileNode($doc, $curNode, $fileName,
$extension);
    }
          } else if($dirElement != "." && $dirElement != ".."){
    $catNode = addCategoryNode($doc, $curNode, $dirElement,
$pathToElement);      
          }
  }
  closedir($currentDirectory);
 }
 return $curNode;
}
 
function addFileNode($doc, $parentNode, $fileName, $extension){
 //echo ("add file node ");

}
 
function addCategoryNode($doc, $parentNode, $catName, $pathToElement){
 //echo ("add cat node ");

}
 
 
$rootDirectory = './images/';
$doc = domxml_new_doc('1.0');

to be
used for a web site');

  



Posted by Tony Reed on January 4, 2005, 2:02 pm
On 4 Jan 2005 06:19:57 -0800
  tom@jb-solutions.co.uk (Tom Jordan) wrote:

:Hi everyone,
:
:I hope someone can shed some light on this for me!
:
:I've just migrated a clients website over to our server. The site's
:done completely in Flash, but uses a little PHP include to pull
:various images from a folder and display them in the Flash movie.

A "little PHP?" Is that like being a "little bit pregnant?"

Anyway, without seeing the errors, or even knowing what version of PHP
you're using, I would say that perhaps the dom/xml stuff isn't enabled
on your server.

--
Tony Reed


Posted by Manuel Lemos on January 4, 2005, 8:10 pm
Hello,

on 01/04/2005 12:19 PM Tom Jordan said the following:


You may want to use PHP Ming extension that lets you generate Flash
movies only with PHP code.

Here you may find an example of how to build a Image slideshow in Flash
using PHP with Ming:

http://www.phpclasses.org/flashslideshow

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html


Posted by Pedro Graca on January 4, 2005, 11:17 pm
Tom Jordan wrote:


I don't know Flash, never used it.



Maybe I can help here :)



What are the versions of PHP in both servers?
What are the differences between their php.ini's?

See my comments below (## lines).





## $curNode never changes (as far as I can see) in the code above.
## You're calling functions where it is a parameter, but those function
## do not declare that specific parameter (or any other) as
## pass by reference, so they get a copy of $curNode and any changes
## they make to it are lost when the function return.



## maybe
## function addFileNode($doc, &$parentNode, $fileName, $extension){
## with the ---------------- '&' here to pass by reference



## You're disregarding the return value of getFileStructure()
## This line does absolutely nothing.



--
Mail to my "From:" address is readable by all at http://www.dodgeit.com/
== ** ## !! ------------------------------------------------ !! ## ** ==
may bypass my spam filter. If it does, I may reply from another address!



Subject Author Date
PHP and Flash Tom Jordan 01-04-2005
If you were  Registered and logged in, you could reply and use other advanced thread options
  • Subject
  • Date

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Driving a better car - Fuelzilla.com

Cabling site for homeowners and pros alike - Cabling-Design.com

1-Script XML SitemapXML Sitemap
Privacy Policy