php½ÓÊÜxmlºÍ·¢ËÍ(post)xml
½ÓÊÕxml:
$xml = file_get_contents('php://input');
·¢ËÍ(post):
$xml_data = <xml>...</xml>";
$url = http://dest_url;
$header[] = "Content-type: text/xml";//¶¨Òåcontent-typeΪxml
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
$response = curl_exec($ch);
if(curl_errno($ch))
{
print curl_error($ch);
}
curl_close($ch);
»òÕߣº
$fp = fsockopen($server, 80);
fputs($fp, "POST $path HTTP/1.0\r\n");
fputs($fp, "Host: $server\r\n");
fputs($fp, "Content-Type: text/xml\r\n");
fputs($fp, "Content-Length: $contentLength\r\n");
fputs($fp, "Connection: close\r\n");
fputs($fp, "\r\n"); // all headers sent
fputs($fp, $xml_data);
$result = '';
while (!feof($fp)) {
$result .= fgets($fp, 128);
}
return $result;
Ïà¹ØÎĵµ£º
1.PHP±à³ÌÄÜÁ¦
2.MysqlÄÜÁ¦
A.Á˽⣺֪µÀʹÓÃPHPÁ´½ÓÊý¾Ý¿â£»¶®µÃһЩ¼òµ¥µÄSQL;½¨Á¢Ò»Ð©¼òµ¥µÄË÷Òý£»¶®µÃÓù¤¾ß¼òµ¥²Ù×÷Ò»ÏÂÊý¾Ý¿â£¨Ôöɾ¸Ä²éÊý¾Ý±í½á¹¹£©¡£
B.ÊìϤ£º¶®µÃÔÚ¿ª·¢Ó¦ÓÃÉÏÉè¼ÆÊý¾Ý¿â£¬½¨Á¢Ò»Ð©ÓÐЧµÄË÷Òý£¬ÓÃexplain·ÖÎöSQLÐÔÄÜ£¬Ñ¹Á¦²âÊԵȵȡ£
C.ºÜÊìϤ£ºÉîÈëÁ˽âÊý¾Ý¿âË÷Òý£¬´æ´¢ÒýÇæÔÀíÒÔ¼°ÔËÐлúÖÆ£ ......
ÐèÇó£º
ÐèÒª¶ÔÁ½¸öĿ¼ÖеÄÎļþÄÚÈݽøÐвéÕÒÌæ»»£¬Á½¸öĿ¼²éÕÒÌæ»»µÄÄÚÈݲ»Ò»Ñù¡£
ʵÏÖÖÐ×¢Ò⼸µã£º
£¨1£©º¯ÊýµÝ¹éµ÷Óã¬À´¼ìË÷×ÓĿ¼£»
£¨2£©º¯ÊýÃû¿ÉÒÔÒÔ²ÎÊýÐÎʽ´«µÝ£»
£¨3£©Ó㿽øÐзÇ̰À·Æ¥Å䣻
......
ĬÈÏ£º
httpd.conf ÔÚ/etc/httpd/conf
my.cnf ÔÚ/etc
php.ini ÔÚ/usr/local/lib
ÔÚUnix ÉÏ£¬php.iniÎļþȱʡ·ÅÔÚ/usr/local/libÉÏÃæ£¬ÒòΪȱʡµÄ´æ·Å·¾¶ÊÇ<install-path>
/lib£¬µ«ÊÇ¿ÉÒÔÔÚ±àÒëµÄʱºòʹÓÃ--with-config-file-path²ÎÊýÀ´ÐÞ¸Äphp.iniµÄ´æ·ÅλÖã¬ÀýÈçÄã¿ÉÒÔʹÓÃ--with-
config-file-path ......
<?php
if(empty($_GET[submit]))
{
?>
<form enctype="multipart/form-data" action="<?php $_SERVER['PHP_SELF']?>?submit=1" method="post">
<input name="filename" type="file">
<input type="submit" value="È·¶¨ÉÏ´«">
</form>
<?php
}
else{
......
JSON ÊÇÒ»ÏîÖ¼ÔÚÔÊÐíÖмä¼þ´´½¨Ê¹Óà JavaScript ¹ÌÓиñʽµÄ¶ÔÏóµÄÐÒé¡£Ëü×îÇ¿´óµÄÊôÐÔÊÇËüÊÇÒ»ÖÖÇáÁ¿¼¶ÐÒé¡£¼òµ¥´¦Àí RSS ¾ÛºÏ»ò recipe Áбíʱ£¬Äú²»ÐèÒªÔÚ JavaScript ÖÐʹÓà XML µÄÈ«²¿¹¦ÄÜ¡£²»ÐèÒªÑéÖ¤¸ñʽ»òÈ·±£ÑϸñµÄÊý¾Ý¼üÈë¡£
±àÂëºÍ½âÂë
ÓÐÁ½¸öº¯ÊýÓÃÓÚ JSON£ºencode ºÍ decode¡£µÚÒ»¸öº¯Êý½«°ÑÈÎÒâÀàÐ͵ÄÊý ......