ÍÂѪÁË,Ìá¸öPHPдXMLµÄÎÊÌâ - PHP / ¿ªÔ´×ÊÔ´
´úÂë:
<?php
$im=$_POST['upPicName'];
$it=$_POST['upPicTitle'];
$pa=$_POST['upPicAlbum'];
$pt=$_POST['upPicThumb'];
//echo $im.$it.$pa.$pt;
$doc = new DOMDocument();
$doc ->formatOutput = true;
$doc->load('pic.xml');
$project=$doc->documentElement->getElementsByTagName('medias');
//$root = $doc->createElement('media');
//$doc->appendChild($root);
/**Ìí¼ÓͼƬµÄÃû×Ö
$root_im = $doc->createAttribute('imgname');
$root->appendChild($root_im);
$root_im_text=$doc->createTextNode($im);
$root_im->appendChild($root_im_text);
//½áÊø
//Ìí¼Ó±êÌâ
$root_it = $doc -> createAttribute('title');
$root->appendChild($root_it);
$root_it_text=$doc->createTextNode($it);
$root_it->appendChild($root_it_text);
//½áÊø
//Ìí¼Óר¼Ãû³Æ
$root_pa=$doc->createAttribute('section');
$root->appendChild($root_pa);
$root_pa_text=$doc->createTextNode($pa);
$root_pa->appendChild($root_pa_text);
//½áÊø
//ÊÇ·ñΪ±êÌâ
$root_pt=$doc->createAttribute('thumb');
$root->appendChild($root_pt);
$root_pt_text=$doc->createTextNode($pt[0]);
$root_pt->appendChild($root_pt_text);
**///½áÊø
$doc->saveXML('pic.xml');
?>
XML:
<?xml version="1.0" encoding="utf
Ïà¹ØÎÊ´ð£º
txt ºÍXML ¸ñʽÏàÓ¦
²»½èÖúDataSet
µ¼Èë¶ÁÈ¡TXTÎļþ
È»ºóÖ±½ÓдÈëXML(ͬһÎļþ,²»Í¬Êý¾Ý,µÝÔöÔÊý¾ÝûÓб»¸²¸ÇÇé¿öÏÂÔö¼ÓÊý¾Ý.)
½Ì¸öÒªµã»ò×îºÃÊÇÓиö´úÂëÌáʾµÄ
¹ý·ºÃºº °ï¸öæÈö^^
²»»á£¬°ïÂ¥Ö÷ ......
Ä¿Ç°ÔÚÎ人ÕÒ¹¤×÷
·¢Ïִ󲿷ֹ«Ë¾ÎÞÍâºõÁ½ÖÖ
Ò»ÖÖÊǸãÍâ°üµÄ ÒªÓÃzend,cakephpµÈÍâ¹ú¿ò¼Ü
»¹ÒªÊìϤÍâ¹ú¿ªÔ´ÏµÍ³
Ò»ÖÖ¹úÄÚµÄ ÎÞÍâºõ dedecms ecshop shopexÕ⼸ÖÖ¸ÄÕ¾µã ÓеĹ«Ë¾ÉõÖÁÄÃһЩ¸üСµÄϵͳ¸ ......
ÈçÌ⣬Ôõôд¸öheadÍ·²¿ ÈÃÒ³Ã滺´æ1ÐÇÆÚ¡£
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
Äã°ÑÀïÃæµÄʱ¼ä£¬¸Ä³Éµ±Ç°Ê±¼ä¼ÓÉÏÒ»¸öÐÇÆÚ
¼ÇµÃҪת»»³Égmtʱ¼ä
ÎÒÕâÑùдµÄ ²»ÖªµÀÐв»ÐС£
Ò»¸öÐ ......
ÊÇÓñðÈËдµÄÀà×öµÄ£¬»¹ÔʱÌáʾYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INSERT INTO admin(seq,passwd,type,n ......