hello every one i was looking for some help in this php code i have php code for gallery flash required file >> data.php to show pic and thumbs and categories can any one help me in the code if there was some thing wrong

<?
	include('init.php');
	define('LF', chr(10));


	print '<?xml version="1.0" encoding="utf-8" standalone="yes"?>'.LF;
	print '<data>'.LF;

	$show_categories=$_GET[show_categories];
	$show_pics=$_GET[show_pics];
	$main_page=$_GET[main_page];

//data.php?show_categories=1
	if ($show_categories!='') {
//		$Open=opendir($gallery_path);
//		while ($Files=readdir($Open)) {

		$cats = getDirectoryList();
		foreach($cats as $Files){
		  if (!is_file($Files)&&$Files!='.'&&$Files!='..') {
			print '  <item title="'.getNameByDir($Files).'" xml_load="data.php?show_pics='.$Files.'"></item>'.LF;
		  };
		};
	};

//data.php?show_pics=peoples
	if ($show_pics!='') {
//		$Open=opendir($gallery_path."/".$show_pics."/thumbs");

		$Open=file($gallery_path."/".$show_pics."/settings.dat");
		foreach($Open as $Files) {
//		  while ($Files=readdir($Open)) {
			$out = array();
			preg_match('/\S+\.(\S+)$/', $Files, $out);
			if ($out[1]==="jpg") 
			  print '  <pic thumb="'.$gallery_path."/".$show_pics."/thumbs/".$Files.'" img="'.$gallery_path."/".$show_pics."/pix/".$Files.'"></pic>'.LF;
		  };
	};

//data.php?main_page=1
	if ($main_page!='') {
	  //$Open=opendir($gallery_path);
	  $cats = getDirectoryList();
//	  while ($Files=readdir($Open)) {
	  foreach($cats as $Files){
		//read category settings
		$FileName="$gallery_path/$Files/settings.dat";
		if (is_file($FileName)) {
		  $File=fopen($FileName,'r');
		  if (filesize($FileName)>0) {
		    $category_settings = file($FileName);
		    $category_settings=$category_settings[0];
		  };
		  fclose($File);
		};
	    if (!is_file($Files)&&$Files!='.'&&$Files!='..') {
	      print '  <item title="'.getNameByDir($Files).'" pic="'.$gallery_path.'/'.$Files.'/pix/'.$category_settings.'"></item>'.LF;
  	    };
	  };
	};

	print '</data>'.LF;
?>

and i need the out put at data.php?main_page=1 like that

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
  <item title="unlimited category" pic="photo_gallery/1295711835.63/pix/8.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></item>
  <item title="unlimited category 1" pic="photo_gallery/1295711839.56/pix/8.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></item>
  <item title="unlimited category 2" pic="photo_gallery/1295711843.82/pix/13.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></item>
</data>

and in data.php?show_categories=1

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
  <item title="unlimited category" xml_load="data.php?show_pics=1295711835.63"></item>
  <item title="unlimited category 1" xml_load="data.php?show_pics=1295711839.56"></item>
  <item title="unlimited category 2" xml_load="data.php?show_pics=1295711843.82"></item>
</data>

and in data.php?show_pic=

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
  <pic thumb="photo_gallery/1295711835.63/thumbs/8.jpg" img="photo_gallery/1295711835.63/pix/8.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1295711835.63/thumbs/4.jpg" img="photo_gallery/1295711835.63/pix/4.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1295711835.63/thumbs/6.jpg" img="photo_gallery/1295711835.63/pix/6.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1295711835.63/thumbs/2.jpg" img="photo_gallery/1295711835.63/pix/2.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1295711835.63/thumbs/1.jpg" img="photo_gallery/1295711835.63/pix/1.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1295711835.63/thumbs/5.jpg" img="photo_gallery/1295711835.63/pix/5.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1295711835.63/thumbs/9.jpg" img="photo_gallery/1295711835.63/pix/9.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
</data>
Member Avatar for diafol

SO what's the problem?

the problem is all this is undefined :

main_page
show_categories
show_pic


when i test the php code on php desiner 7 it give me undefind error on lines 9,10,11
in data.php

Member Avatar for diafol
$show_categories=$_GET[show_categories];	
$show_pics=$_GET[show_pics];
$main_page=$_GET[main_page];

These lines??
If the $_GETs don't exist, could throw an error. Also good practice to enclose key in quotes, e.g. $_GET

hum. test it and make them all

$show_categories=$_GET;
$show_pics=$_GET{'show_pic'}
$main_page=$_GET;

and still not work :S
this all php code in this link may be u can check and hope to solve this thank for all help me.

[link snipped]

Member Avatar for diafol

THat's not a link to the code - that's a download link and =has a redirect to some advertising. How about posting the code?

$show_pics=$_GET{'show_pic'}

That'll give you an error, I would imagine.

ok that is

init.php

<?
header('Content-type: text/html; charset=UTF-8');
	require ("config.php");
	
function getmicrotime() 
{ 
   list($usec, $sec) = explode(" ", microtime()); 
   return ((float)$usec + (float)$sec); 
}

function getNameByDir($dirname)
{
	$categories = file("categories.mdb");
	foreach ($categories as $v)
	{
		list($name,$dir) = explode("|",$v);
		if(trim($dir) == trim($dirname))
			return $name;
	}
	
	return $dirname;
}

function delRowByDir($dirname)
{
	$categories = file("categories.mdb");
	$cont = "";
	foreach ($categories as $v)
	{
		list($name,$dir) = explode("|",$v);
		if(trim($dir) != trim($dirname))
			$cont .= $v;
	}
	$handle = fopen("categories.mdb", "w");
	fwrite($handle,$cont);
}

function renameCategory($dirname,$newname)
{
	$categories = file("categories.mdb");
	$cont = "";
	foreach ($categories as $v)
	{
		list($name,$dir) = explode("|",$v);
		if(trim($dir) != trim($dirname))
			$cont .= $v;
		else
			$cont .= $newname."|".$dir."\n";
	}
	$handle = fopen("categories.mdb", "w");
	fwrite($handle,$cont);
}

function getCategoryList()
{
	$categories = file("categories.mdb");
	$cats = array();
	foreach ($categories as $v)
	{
		list($name,$dir) = explode("|",$v);
		if(!empty($name))
			$cats[] = trim($name);
	}
	
	return $cats;
}

function getDirectoryList()
{
	$categories = file("categories.mdb");
	$dirs = array();
	foreach ($categories as $v)
	{
		list($name,$dir) = explode("|",$v);
		if(!empty($dir))
			$dirs[] = trim($dir);
	}
	
	return $dirs;
}

?>

And config.php

<?
$admin_login="mina";
$admin_pass="123456";
$gallery_path="gallery";
?>

and data.php

its up and fixed error that ardav show me it .

Member Avatar for diafol

does it work now? if so mark it solved, otherwise, give more info on the problem.

no its not work yet still got same error. when i test data.php code on php programe it give me this error.

Notice: Undefined index: show_categories in C:\AppServ\www\vb1\data.php on line 8 Call Stack: 0.0017 341472 1. {main}() C:\AppServ\www\vb1\data.php:0 Notice: Undefined index: show_pics in C:\AppServ\www\vb1\data.php on line 9 Call Stack: 0.0017 341472 1. {main}() C:\AppServ\www\vb1\data.php:0 Notice: Undefined index: main_page in C:\AppServ\www\vb1\data.php on line 10 Call Stack: 0.0017 341472 1. {main}() C:\AppServ\www\vb1\data.php:0

Member Avatar for diafol

This sounds as if you're not passing the querystring parameters, try:

if($_GET['show_categories'])$show_categories=$_GET['show_categories'];
if($_GET['show_pic'])$show_pics=$_GET['show_pic'];
if($_GET['main_page'])$main_page=$_GET['main_page'];

when i change if statment of show_categories i got many undefined error like that :

Notice: Undefined index: show_categories in C:\AppServ\www\vb1\~data.php on line 8 Call Stack: 0.0016 344272 1. {main}() C:\AppServ\www\vb1\~data.php:0 Notice: Undefined index: show_pics in C:\AppServ\www\vb1\~data.php on line 9 Call Stack: 0.0016 344272 1. {main}() C:\AppServ\www\vb1\~data.php:0 Notice: Undefined index: main_page in C:\AppServ\www\vb1\~data.php on line 10 Call Stack: 0.0016 344272 1. {main}() C:\AppServ\www\vb1\~data.php:0 Notice: Undefined index: show_categories in C:\AppServ\www\vb1\~data.php on line 40 Call Stack: 0.0016 344272 1. {main}() C:\AppServ\www\vb1\~data.php:0 Notice: Undefined variable: category_settings in C:\AppServ\www\vb1\~data.php on line 56 Call Stack: 0.0016 344272 1. {main}() C:\AppServ\www\vb1\~data.php:0 Notice: Undefined variable: category_settings in C:\AppServ\www\vb1\~data.php on line 56 Call Stack: 0.0016 344272 1. {main}() C:\AppServ\www\vb1\~data.php:0 Notice: Undefined variable: category_settings in C:\AppServ\www\vb1\~data.php on line 56 Call Stack: 0.0016 344272 1. {main}() C:\AppServ\www\vb1\~data.php:0

more explain to my problem :

when i open my flash using cs4 i got error on data.php?mian_page=1
and the the action that call data.php

varList.push("data.php?main_page=1");
varXML.load(varList[0]);
Member Avatar for diafol

Yes, well you don't have show_categories nor show_pic in the querystring (url) - so they won't be set. Perhaps you should set default values

$show_categories="....";
$show_pics="....";
$main_page="....";

before doing the if commands.
Obviously change the .... for default values.

i chage it to default value and still got may undefined value like that :

<?
	include('init.php');
	define('LF', chr(10));
    
    
	print '<?xml version="1.0" encoding="utf-8" standalone="yes"?>'.LF;
	print '<data>'.LF;
 

	$show_categories=$_GET[''];
	$show_pics=$_GET[''];
	$main_page=$_GET[''];

//data.php?show_categories=1
	if ($show_categories="....") {
//		$Open=opendir($gallery_path);
//		while ($Files=readdir($Open)) {

		$cats = getDirectoryList();
		foreach($cats as $Files){
		  if (!is_file($Files)&&$Files!='.'&&$Files!='..') {
			print '  <item title="'.getNameByDir($Files).'" xml_load="data.php?show_pics='.$Files.'"></item>'.LF;
		  };
		};
	};

//data.php?show_pics=peoples
	if ($show_pics="....") {
//		$Open=opendir($gallery_path."/".$show_pics."/thumbs");

		$Open=file($gallery_path."/".$show_pics."/settings.dat");
		foreach($Open as $Files) {
//		  while ($Files=readdir($Open)) {
			$out = array();
			preg_match('/\S+\.(\S+)$/', $Files, $out);
			if ($out[1]==="jpg") 
			  print '  <pic thumb="'.$gallery_path."/".$show_pics."/thumbs/".$Files.'" img="'.$gallery_path."/".$show_pics."/pix/".$Files.'"></pic>'.LF;
		  };
	};

//data.php?main_page=1
	if ($main_page="....") {
	  //$Open=opendir($gallery_path);
	  $cats = getDirectoryList();
//	  while ($Files=readdir($Open)) {
	  foreach($cats as $Files){
		//read category settings
		$FileName="$gallery_path/$Files/settings.dat";
		if (is_file($FileName)) {
		  $File=fopen($FileName,'r');
		  if (filesize($FileName)>0) {
		    $category_settings = file($FileName);
		    $category_settings=$category_settings[0];
		  };
		  fclose($File);
		};
	    if (!is_file($Files)&&$Files!='.'&&$Files!='..') {
	      print '  <item title="'.getNameByDir($Files).'" pic="'.$gallery_path.'/'.$Files.'/pix/'.$category_settings.'"></item>'.LF;
  	    };
	  };
	};

	print '</data>'.LF;
?>

that is the error what i got :


Notice: Undefined index: in C:\AppServ\www\vb1\data.php on line 10 Call Stack: 0.0016 343704 1. {main}() C:\AppServ\www\vb1\data.php:0 Notice: Undefined index: in C:\AppServ\www\vb1\data.php on line 11 Call Stack: 0.0016 343704 1. {main}() C:\AppServ\www\vb1\data.php:0 Notice: Undefined index: in C:\AppServ\www\vb1\data.php on line 12 Call Stack: 0.0016 343704 1. {main}() C:\AppServ\www\vb1\data.php:0 Warning: file(photo_gallery/..../settings.dat): failed to open stream: No such file or directory in C:\AppServ\www\vb1\data.php on line 31 Call Stack: 0.0016 343704 1. {main}() C:\AppServ\www\vb1\data.php:0 0.0056 374456 2. file() C:\AppServ\www\vb1\data.php:31 Warning: Invalid argument supplied for foreach() in C:\AppServ\www\vb1\data.php on line 32 Call Stack: 0.0016 343704 1. {main}() C:\AppServ\www\vb1\data.php:0

Member Avatar for diafol
<?php
	include('init.php');
	define('LF', chr(10));
 
 
	print '<?xml version="1.0" encoding="utf-8" standalone="yes"?>'.LF;
	print '<data>'.LF;


//shouldn't really need to do the below, but won't hurt
$show_categories="";
$show_pics="";
$main_page="";

//conditional to overwrite any default values you may want to put into the vars above.
if($_GET['show_categories'])$show_categories=$_GET['show_categories'];
if($_GET['show_pic'])$show_pics=$_GET['show_pic'];
if($_GET['main_page'])$main_page=$_GET['main_page'];


//REMAINDER OF YOUR ORIGINAL PAGE

//data.php?show_categories=1
	if ($show_categories!='') {
//		$Open=opendir($gallery_path);
//		while ($Files=readdir($Open)) {
 
		$cats = getDirectoryList();
		foreach($cats as $Files){
		  if (!is_file($Files)&&$Files!='.'&&$Files!='..') {
			print '  <item title="'.getNameByDir($Files).'" xml_load="data.php?show_pics='.$Files.'"></item>'.LF;
		  };
		};
	};
 
//data.php?show_pics=peoples
	if ($show_pics!='') {
//		$Open=opendir($gallery_path."/".$show_pics."/thumbs");
 
		$Open=file($gallery_path."/".$show_pics."/settings.dat");
		foreach($Open as $Files) {
//		  while ($Files=readdir($Open)) {
			$out = array();
			preg_match('/\S+\.(\S+)$/', $Files, $out);
			if ($out[1]==="jpg") 
			  print '  <pic thumb="'.$gallery_path."/".$show_pics."/thumbs/".$Files.'" img="'.$gallery_path."/".$show_pics."/pix/".$Files.'"></pic>'.LF;
		  };
	};
 
//data.php?main_page=1
	if ($main_page!='') {
	  //$Open=opendir($gallery_path);
	  $cats = getDirectoryList();
//	  while ($Files=readdir($Open)) {
	  foreach($cats as $Files){
		//read category settings
		$FileName="$gallery_path/$Files/settings.dat";
		if (is_file($FileName)) {
		  $File=fopen($FileName,'r');
		  if (filesize($FileName)>0) {
		    $category_settings = file($FileName);
		    $category_settings=$category_settings[0];
		  };
		  fclose($File);
		};
	    if (!is_file($Files)&&$Files!='.'&&$Files!='..') {
	      print '  <item title="'.getNameByDir($Files).'" pic="'.$gallery_path.'/'.$Files.'/pix/'.$category_settings.'"></item>'.LF;
  	    };
	  };
	};
 
	print '</data>'.LF;
?>

That was what I meant.

i test that code and still got same error:

Notice: Undefined index: show_categories in C:\AppServ\www\vb1\data.php on line 16 Call Stack: 0.0014 345624 1. {main}() C:\AppServ\www\vb1\data.php:0 Notice: Undefined index: show_pic in C:\AppServ\www\vb1\data.php on line 17 Call Stack: 0.0014 345624 1. {main}() C:\AppServ\www\vb1\data.php:0 Notice: Undefined index: main_page in C:\AppServ\www\vb1\data.php on line 18 Call Stack: 0.0014 345624 1. {main}() C:\AppServ\www\vb1\data.php


But if i deleted lines 15,16,17,18 i got no error and test it on my flash and still my gallery photo didn't appered .

Member Avatar for diafol

Sorry how about this:

if(isset($_GET['show_categories']))$show_categories=$_GET['show_categories'];
if(isset($_GET['show_pic']))$show_pics=$_GET['show_pic'];
if(isset($_GET['main_page')])$main_page=$_GET['main_page'];

yep it work with no error undefined . but when i type on me internet explorer :

http://localhost/vb1/data.php?main_page=1

i got this error :

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Invalid at the top level of the document. Error processing resource 'http://localhost/vb1/data.php?main_page=1'.

and it i do view source it give me :

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
<item title="Test " pic="photo_gallery/1/pix/8.jpg
"></item>
<item title="Test 1" pic="photo_gallery/2/pix/8.jpg
"></item>
<item title="Test 2" pic="photo_gallery/3/pix/13.jpg
"></item>
</data>

i think now there is not problem in data.php but still my pictuer didnt appered i dont know why

Member Avatar for diafol

Are you trying to place two lots of xml doctype declaration?

Because you're using XML, does the brwser know to display the pic as an image? I thought that XML would do this:

<image>
    <url>photo_gallery/2/pix/8.jpg</url>
    <title>Test</title>
    <link>http://www.example.com</link>
</image>

I have to admit, I'm no expert on XML.

yes i wanna show gallery photo and thumbs by using php code .. i wanna put link to show u exmple same as my but i dont know if rules of daniweb.com alow me do this or not . or i can send it by private massage to show u what i mean . thx for ur support.

Member Avatar for diafol

No PM, link not advisable. Only code or screenshots.

ok i will take screenshots and remover any advertising on it . to show u what i mean .

have alook on this screenshots i take them from online web site same as my :

Member Avatar for diafol

OK, so what's the problem? Are you trying to get the data to turn into html and show images in a webpage? DO you need something like SImpleXML? You mention Flash in your title. DOes a flash file need to read the data?

the problem is :

(1) my flash need file data.php to start and if i remove it didnt start on both " my pc & my web host " so i should make file data.php to start it .

(2) i have 3 gategories if i make this 4 file >> data.php & data1.php & data2.php & data3.php to show files as xml the flash work fine with no error on my pc only and if i upload it on my web host it didnt show photo or categories or description.

this is xml code that i put it on 4 file :

data.php

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
  <item title="Test" xml_load="data1.php"></item>
  <item title="Test 1" xml_load="data2.php"></item>
  <item title="Test 2" xml_load="data3.php"></item>
</data>

data1.php

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
  <pic thumb="photo_gallery/1/thumbs/4.jpg" img="photo_gallery/1/images/4.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1/thumbs/8.jpg" img="photo_gallery/1/images/8.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1/thumbs/7.jpg" img="photo_gallery/1/images/7.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1/thumbs/3.jpg" img="photo_gallery/1/images/3.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1/thumbs/6.jpg" img="photo_gallery/1/images/6.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1/thumbs/2.jpg" img="photo_gallery/1/images/2.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1/thumbs/5.jpg" img="photo_gallery/1/images/5.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/1/thumbs/1.jpg" img="photo_gallery/1/images/1.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
</data>

data2.php

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
  <pic thumb="photo_gallery/2/thumbs/1.jpg" img="photo_gallery/2/images/1.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/2/thumbs/2.jpg" img="photo_gallery/2/images/2.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/2/thumbs/3.jpg" img="photo_gallery/2/images/3.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
</data>

data3.php

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<data>
  <pic thumb="photo_gallery/3/thumbs/5.jpg" img="photo_gallery/3/images/5.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
  <pic thumb="photo_gallery/3/thumbs/4.jpg" img="photo_gallery/3/images/4.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>
</data>
Member Avatar for diafol

Ok, so let me get this right. It works on local machine but not on remote?

How about using include files? data1/data2/data3?

if(isset($_GET[...])){
  include(...);
}...

i test it on my local machine no working too only work if i open index.html from my pc .

i got some good new i change data.php to this code :

<?php
define('LF', chr(10));
print '<?xml version="1.0" encoding="utf-8" standalone="yes"?>'.LF;
print '<data>'.LF;

  print '<item title="Test " xml_load="data1.php"></item>'.LF;
  print '<item title="Test 1" xml_load="data2.php"></item>'.LF;
  print '<item title="Test 2" xml_load="data3.php"></item>'.LF;

print '</data>'.LF;
?>

and it work for show categories.

and change data1.php to this :

<?php
define('LF', chr(10));
print '<?xml version="1.0" encoding="utf-8" standalone="yes"?>'.LF;
print '<data>'.LF;
  print '<pic thumb="photo_gallery/1/thumbs/4.jpg" img="photo_gallery/1/images/4.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>'.LF;
  print '<pic thumb="photo_gallery/1/thumbs/8.jpg" img="photo_gallery/1/images/8.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>'.LF;
  print '<pic thumb="photo_gallery/1/thumbs/7.jpg" img="photo_gallery/1/images/7.jpg" descr="YOU+CAN+ADD+UNLIMITED+PHOTOS+AND+CREATE+UNLIMITED+CATEGORIES"></pic>'.LF;
  

print '</data>'.LF;
?>

and it work too :) on local machine i will test on my web host and tell u the result.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.