Flash+xml的相册上传图片后xml怎么生成该图片的数据???
我从网上下的源码,上传图片后,不知道怎么用PHP向xml文件写入新上传的图片的数据和删除图片后怎么用PHP xml的信息??
index.php<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Flash+xml实现的翻书效果的相册 - 分享JavaScript-sharejs.com</title>
<meta name="Copyright" content="JavaScript分享网 http://www.sharejs.com/" />
<meta name="description" content="Flash+xml实现的翻书效果的相册,JavaScript分享网" />
<meta content="JavaScript,分享,JavaScript代码,Ajax" name="keywords" />
</head>
<body>
<hr />
<DIV align="center" >
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="800" height="470">
<param name="movie" value="book.swf" />
<param name="quality" value="high" />
<embed src="book.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="470"></embed>
</object>
<br />
<br />
</div><br><br>
<div align="center">
<script language="javascript" src="http://www.sharejs.com/js/720.js"></script>
<br><br>
<a href="http://www.sharejs.com">http://www.sharejs.com</a>
</div>
</body>
</html>
imgallery.xml
<?xml version="1.0" encoding="gb2312"?>
<gallery>
<photo>
<filename>./img/img01.jpg</filename>
<phototitle>www.sharejs.com - 图片1</phototitle>
</photo> <photo>
<filename>./img/img02.jpg</filename>
<phototitle>www.sharejs.com - 图片2</phototitle>
</photo> <photo>
<filename>./img/img03.jpg</filename>
<phototitle>www.sharejs.com - 图片3</phototitle>
</photo> <photo>
<filename>./img/img04.jpg</filename>
<phototitle>www.sharejs.com - 图片4</phototitle>
</photo> <photo>
<filename>./img/img05.jpg</filename>
<phototitle>www.sharejs.com - 图片5</phototitle>
</photo> <photo>
<filename>./img/img06.jpg</filename>
<phototitle>www.sharejs.com - 图片6</phototitle>
</photo> <photo>
<filename>./img/img07.jpg</filename>
<phototitle>www.sharejs.com - 图片7</phototitle>
</photo> <photo>
<filename>./img/img08.jpg</filename>
<phototitle>www.sharejs.com - 图片8</phototitle>
</photo> <photo>
<filename>./img/img09.jpg</filename>
<phototitle>www.sharejs.com - 图片9</phototitle>
</photo> <photo>
<filename>./img/img10.jpg</filename>
<phototitle>www.sharejs.com - 图片10</phototitle>
</photo> <photo>
<filename>./img/img11.jpg</filename>
<phototitle>www.sharejs.com - 图片11</phototitle>
</photo> <photo>
<filename>./img/img12.jpg</filename>
<phototitle>www.sharejs.com - 图片12</phototitle>
</photo> <photo>
<filename>./img/img13.jpg</filename>
<phototitle>www.sharejs.com - 图片13</phototitle>
</photo> <photo>
<filename>./img/img14.jpg</filename>
<phototitle>www.sharejs.com - 图片14</phototitle>
</photo> <photo>
<filename>./img/img15.jpg</filename>
<phototitle>www.sharejs.com - 图片15</phototitle>
</photo></gallery>
我从网上下的源码,上传图片后,不知道怎么用PHP向xml文件写入新上传的图片的数据和删除图片后怎么用PHP xml的信息??
index.php<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Flash+xml实现的翻书效果的相册 - 分享JavaScript-sharejs.com</title>
<meta name="Copyright" content="JavaScript分享网 http://www.sharejs.com/" />
<meta name="description" content="Flash+xml实现的翻书效果的相册,JavaScript分享网" />
<meta content="JavaScript,分享,JavaScript代码,Ajax" name="keywords" />
</head>
<body>
<hr />
<DIV align="center" >
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="800" height="470">
<param name="movie" value="book.swf" />
<param name="quality" value="high" />
<embed src="book.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="470"></embed>
</object>
<br />
<br />
</div><br><br>
<div align="center">
<script language="javascript" src="http://www.sharejs.com/js/720.js"></script>
<br><br>
<a href="http://www.sharejs.com">http://www.sharejs.com</a>
</div>
</body>
</html>
imgallery.xml
<?xml version="1.0" encoding="gb2312"?>
<gallery>
<photo>
<filename>./img/img01.jpg</filename>
<phototitle>www.sharejs.com - 图片1</phototitle>
</photo> <photo>
<filename>./img/img02.jpg</filename>
<phototitle>www.sharejs.com - 图片2</phototitle>
</photo> <photo>
<filename>./img/img03.jpg</filename>
<phototitle>www.sharejs.com - 图片3</phototitle>
</photo> <photo>
<filename>./img/img04.jpg</filename>
<phototitle>www.sharejs.com - 图片4</phototitle>
</photo> <photo>
<filename>./img/img05.jpg</filename>
<phototitle>www.sharejs.com - 图片5</phototitle>
</photo> <photo>
<filename>./img/img06.jpg</filename>
<phototitle>www.sharejs.com - 图片6</phototitle>
</photo> <photo>
<filename>./img/img07.jpg</filename>
<phototitle>www.sharejs.com - 图片7</phototitle>
</photo> <photo>
<filename>./img/img08.jpg</filename>
<phototitle>www.sharejs.com - 图片8</phototitle>
</photo> <photo>
<filename>./img/img09.jpg</filename>
<phototitle>www.sharejs.com - 图片9</phototitle>
</photo> <photo>
<filename>./img/img10.jpg</filename>
<phototitle>www.sharejs.com - 图片10</phototitle>
</photo> <photo>
<filename>./img/img11.jpg</filename>
<phototitle>www.sharejs.com - 图片11</phototitle>
</photo> <photo>
<filename>./img/img12.jpg</filename>
<phototitle>www.sharejs.com - 图片12</phototitle>
</photo> <photo>
<filename>./img/img13.jpg</filename>
<phototitle>www.sharejs.com - 图片13</phototitle>
</photo> <photo>
<filename>./img/img14.jpg</filename>
<phototitle>www.sharejs.com - 图片14</phototitle>
</photo> <photo>
<filename>./img/img15.jpg</filename>
<phototitle>www.sharejs.com - 图片15</phototitle>
</photo></gallery>
$cont =fopen("imgallery.xml",'w');
fwrite($cont,$data);
fclose($cont);
看不明白,举个例子吧,新上传的图片img16、(./img/img16.jpg 图片路径),数据库得到该数据,
xml文件应该生成
<photo>
<filename>./img/img16.jpg</filename>
<phototitle>www.sharejs.com - 图片16</phototitle>
</photo>
怎么写?后台有删除功能,删除了数据库该记录,xml应该同时删除<photo>
<filename>./img/img15.jpg</filename>
<phototitle>www.sharejs.com - 图片15</phototitle>
</photo>
怎么实现??
此时的$xml你可以把它理解成为是一个数组,用操作数组的方法操作他就行了.最后
File_Put_Contents("../??.XML",$VAR,LOCK_EX);重写