Jump to content

Search the Community

Showing results for tags 'dynamic xml'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I stumbled upon a video in develop php, that uses php to create a dynamic xml file. I tried to use their code, and modify to my needs but I wasn't able to. I need a php file that creates an xml with all the subfolders in a folder and the images inside those subfolders. Can someone please help me get this working? Thanks. This is what I have tried so far: http://www.developphp.com/video/PHP/Image-Gallery-PHP-Loop-Files-Dynamic-XML-Tutorial <?php header("Content-Type: text/xml"); // set the content type to xml // Initialize the xmlOutput variable $xmlBody = '<?xml version="1.0" encoding="ISO-8859-1"?>'; $dir = "../images/"; // Specify Directory where images are $xmlBody .= "<XML>"; // Start XMLBody output // open specified directory using opendir() the function $dirHandle = opendir($dir); // Create incremental counter variable if needed $i = 0; $root = '../images'; $iter = new RecursiveIteratorIterator( new RecursiveDirectoryIterator($root, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD // Ignore "Permission denied" ); $paths = array($root); foreach ($iter as $path => $dir) { if ($dir->isDir()) { $paths[] = $path; if(!is_dir($file) && strpos($file, '.jpg')){ $i++; // increment $i by one each pass in the loop $xmlBody .= <'$paths[$iter]'>' '<'$paths[$iter]'> <picNum>' . $i . '</picNum> <picURL>' . $dir . '' . $file . '</picURL> </Picture>'; } // close the if statement } } while ($file = readdir($dirHandle)) { // if file is not a folder and if file name contains the string .jpg if(!is_dir($file) && strpos($file, '.jpg')){ $i++; // increment $i by one each pass in the loop } // close the if statement } // End while loop closedir($dirHandle); // close the open directory $xmlBody .= "</XML>"; echo $xmlBody; // output the gallery data as XML file for flash ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.