Php Xml½âÎöÖ®DOMDocumentʹÓ÷½·¨Ç³½â
Óõ½µÄXMLÎļþ»¹ÒÔ“Php Xml´¦ÀíÖ®simplexmlʹÓ÷½·¨Ç³Ì¸”Ò»ÎÄÖеÄXMLΪÀý£¬ÎļþÃûΪ£ºme.xml¡£´úÂëÈçÏ£º
PHP XML´¦ÀíXML´úÂë
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
phplamp
>
<
post
>
<
title
id
=
"1"
>
PHP XML´¦Àí½éÉÜÒ»
</
title
>
<
details
>
ÏêϸÄÚÈÝÒ»
</
details
>
</
post
>
<
post
>
<
title
id
=
"2"
>
PHP XML´¦Àí½éÉܶþ
</
title
>
<
details
>
ÏêϸÄÚÈݶþ
</
details
>
</
post
>
<
post
>
<
title
id
=
"3"
>
PHP XML´¦Àí½éÉÜÈý
</
title
>
<
details
>
ÏêϸÄÚÈÝÈý
</
details
>
</
post
>
</
phplamp
>
È»ºó¾ÍÐèÒªÓÃPHPµÄDOMDocumentÈ¥´¦ÀíÕâ¸öÎļþ£¬½«XMLÎļþÖеÄÈκÎÔªËض¼½âÎö³öÀ´¡£´úÂëÈçÏ£¬ÀïÃæÓÐ×¢ÊÍ¡£
PHP Xml½âÎöDOMDocument´úÂë
<?php
// Ê×ÏÈÒª½¨Ò»¸öDOMDocument¶ÔÏó
$xml
=
new
DOMDocument();
// ¼ÓÔØXmlÎļþ
$xml
->load(
"me.xml"
);
// »ñÈ¡ËùÓеÄpost±êÇ©
$postDom
=
$xml
->getElementsByTagName(
"post"
);
// Ñ»·±éÀúpost±êÇ©
foreach
(
$po
Ïà¹ØÎĵµ£º
½ñÌìÊÇÒ»¸öÖµµÃ¼ÍÄîµÄÈÕ×Ó,ÖÕÓڰѱðµÄÊÂÇ鶼¸ÉµôÁË,¿ÉÒÔÒ»ÐÄÒ»ÒâµÄѧϰÎÒ×î°®µÄPHPÁË,С»¶ºôÒ»ÏÂ.Ò®~~
Ê×ÏÈ.½áºÏ×Ô¼ºµÄ˼¿¼,ÓÐÁ˼¸¸ö¹ØÓÚ1+1=2µÄ±íʾ·½·¨,¾ßÌåÂÞÁÐÈçÏÂ:
Ê×ÏÈÊÇÒ»Öֺܼòµ¥µÄ±íʾ·½·¨:
<?php
$a =1+1;
echo "1+1=".$a;
?>
//ÕâÖÖ·½·¨ÓõIJ¢²»¶à,Ö»ÊÇΪÁ˼ÓÉî¶Ô±äÁ¿ ......
1¡¢$_SERVER['SCRIPT_NAME']¡¢$_SERVER['PHP_SELF']ºÍ$_SERVER['REQUEST_URI']Çø±ð
Àý×Ó:http://localhost/phpwind75/test.php/%22%3E%3Cscript%3Ealert(’xss’)%3C/script%3E%3Cfoo
$_SERVER['SCRIPT_NAME']Ö»»ñÈ¡½Å±¾Ãû£¬²»»ñÈ¡²ÎÊý,Êä³ö½á¹ûΪ:test.php;
$_SERVER['PHP_SELF']»ñÈ¡½Å±¾Ãûºó£¬Í¬Ê±»ñÈ ......
includeʵÏÖ¹ú¼Ê»¯
½«index.php½øÐзÒë:
IndexÄÚÈÝ
1. Index
2. About us
ÎÒÃÇ¿ÉÒÔ½«index.phpÉèÖÃΪһ¸ö·ÒëÄ£°æ£¬ËùÓгöÏÖ×Ö·ûµÄµØ·½£¬¶¼¶¨ÒåΪ±äÁ¿£¬Èç1£¬2²¿·ÖÉèÖÃΪ·ÒëµÄ±äÁ¿$menu_index, $menu_aboutus.
......
ÓÐʱºònginx£¬apache£¬mysql£¬php±àÒëÍêÁËÏë¿´¿´±àÒë²ÎÊý¿ÉÒÔÓÃÒÔÏ·½·¨
nginx±àÒë²ÎÊý£º
#/usr/local/nginx/sbin/nginx -V
CODE:
nginx version: nginx/0.6.32
built by gcc 4.1.2 20071124 (Red Hat 4.1.2-42)
configure arguments: --user=www --group=www --prefix=/usr/local/nginx/ --with-http_stub_status_mo ......
Ò»¡¢°²×°ÏµÍ³»·¾³
1¡¢ÏµÍ³£ºcentos5
2¡¢²âÊÔÔÚvm5.5
×¼±¸Èí¼þ
lighttpd-1.4.18
ÏÂÔصØÖ·
mysql-5.0.41
part1ÏÂÔصØÖ·
part2ÏÂÔصØÖ·
part3ÏÂÔصØÖ·
php-5.2.3
ÏÂÔصØÖ·
SupeSite/X-Space
part1ÏÂÔصØÖ·
part2ÏÂÔصØÖ·
part3ÏÂÔصØÖ·
discuz
ÏÂÔصØÖ·
¶þ¡¢´î½¨web·þÎñÆ÷°²×°¹ý³Ì
1¡¢mysql5°²×°
$ tar zx ......