GyPSii API PHPÇëÇóʾÀý
¸ù¾ÝGyPSii APIÌṩµÄ²Ù×÷ÀàºÍ·½·¨£¬·¢ÏÖÇëÇó»áʧ°Ü£¬·µ»ØµÄÊÇÒ»¸öbed request¡£ÔÒòÆäʵºÜ¼òµ¥£¬µ«Ò»Ö±Ã»ÓÐÕÒµ½£¬×îÖÕÔÒòÊǶԷ½ÌṩµÄhostÊÇ´íÎóµÄ£¬Ã»ÌìÀí¡£
¶Ô·½ÌṩµÄhostºÍuri£º
host:http://dev3.gypsii.com/gypsii
uri:http://dev3.gypsii.com/gypsii/xmlservice.cgi
Õâ¸öhost¾ÍÊÇ´íµÄ£¬Ó¦¸ÃÊÇ£ºdev3.gypsii.com =¡£=£¡£¡
GyPSiiXMLRPCÕâ¸ö·½·¨Ò²ÊÇÓÐÎÊÌâµÄ£¬Ö»Ö±ÀûÓÃAPIÀïдµÄÊDz»Ðеģ¬×Ðϸ¿´Õâ¸öÀà»á·¢ÏÖÓÐÒ»¸ömakeUri£¬ÓÃÕâ¸ö·½·¨´¦Àíһϴ«µÝµÄ
uri¾Í¿ÉÒÔÁË£¬Ò²¾ÍÊÇGyPSiiXMLRPC·½·¨Àï¼ÓÉÏ£º
$uri = $this->makeUri( $uri );
ÇëÇóʾÀý£º
include "client.php";
$http = new Net_HTTP_Client();
$uri="http://dev3.gypsii.com/gypsii/xmlservice.cgi";
$host="dev3.gypsii.com";
$body=u();
$http->connect( "$host", 80 ) or die( "connect problem" );
$http->GyPSiiXMLRPC( $uri, $host, $pid, $body);
/*µÇ¼ÐÅÏ¢
username:̞
password:ÃÜÂë
*/
function u(){
return "<?xml version='1.0' encoding='utf8'?><request service='com:gypsii:service:security:SecurityService' method='login' version='1.1.0'><param name='username'><string>8619901111111</string></param><param name='password'><string>1111</string></param></request>";
}
ÔËÐк󣬳ɹ¦·þÎñÆ÷»á·µ»ØËùÇëÇóµÄÏà¹ØÐÅÏ¢£¬µ±È»»ØÀ´µÄÒ²ÊÇÒ»¸öxml¸ñʽµÄ£¬Õâ¸öʱºòÓÃsimplexml_load_stringº¯ÊýÀ´´¦Àí£¬½«ÐèÒªµÄÊý¾ÝÌáÈ¡³öÀ´£¬È»ºó×Ô¼º´¦Àí¾ÍºÃÁË¡£
·þÎñÆ÷µÄ·µ»ØÐÅÏ¢£¬ÓÃ$http->responseBody£¬¼´¿É»ñµÃ£¬$httpÊÇʲô£¬¿É¿´http://blog.csdn.net/Onlyfu/archive/2010/04/29/5544343.aspx
ÓÚÊǾÍÓУº$xml=simplexml_load_string($http->responseBody);
Êä³ö$xmlÊÇÒ»¸öÊý×飬ͨ¹ý$xml->xpath¿ÉÒÔÈ¡µ½ÏëÒªµÄÖµ£¬È磺$user_id=$xml->xpath("//field[@name='USER_ID']");Õâ¸ö¿ÉÒÔÈ¡µ½¹ØÓÚUSER_IDµÄÐÅÏ¢£¬µ«ËüÈÔÈ»ÊÇÒ»¸öÊý×飬¸ú×ÅÕâÑù¾Í¿ÉÒÔÈ¡µ½ÎÒÃÇÏëÒªµÄuser_idÁË£¬$userid=$user_id[0]->long;Èç¹û²»ÖªµÀÕâ¸öÊÇÔõô»ØÊ£¬°Ñ$user_idÊä³öÀ´¿´¿´¾ÍÖªµÀ£¬Ã¿¸öÊý¾Ý¶¼Óв»Í¬µÄÊý¾ÝÀàÐÍ£¬user_idÊÇlongËùÒÔËü×îºóÊÇ$iser_id[0]->long£¬»»Ò»¸ö¾Í²»ÊÇÕâ¸öÁË£¬±ÈÈ
Ïà¹ØÎĵµ£º
apacheµÄ¾²Ì¬/¶¯Ì¬±àÒëÔÚapache+php+mysqlµÄÓ¦ÓÃ
ÎÒÏë´ó¼ÒÓв»ÉÙ¶¼³É¹¦ÊµÏÖapache+php+mysql£¬ÍøÉϵÄÎÄÕÂÒ²Óв»ÉÙ£¬µ«ÎÒ·¢ÏÖ²»ÉÙÎÄÕ¶¼ÊdzÀ´³È¥£¬²¢ÇÒ
ûÓÐ˵Ã÷°×±àÒëµÄ·½Ê½£¬ÓеÄË÷ÐÔapache1.3µÄ±àÒë·½·¨Ô·â²»¶¯µÄ°á¹ýÀ´Ì×ÔÚapache2.0£¬ÏÔÈ»Îóµ¼Ò»Ð©²ËÄñ £¡
ÎÒ½ñÌì¾ÍÒÔapache+mysql+php˵һϾ²Ì¬±àÒëºÍDSO¶¯Ì¬±à ......
Ñ¿ÓêÔ´´PHPÐÂÎÅϵͳ½Ì³Ì£¨µÚÒ»°æ£©µÚÒ»½²£ºÓà phpmyadmin ½¨Á¢Êý¾Ý¿â
Ê×ÏȽ¨Á¢Ò»¸öÊý¾Ý¿â£¬ÃûΪ yayu ¡£ÔÚÕâ¸öÊý¾Ý¿âϽ¨Á¢Ò»¸öÊý¾Ý±í£¬ÃûΪ news ¡£ÏÂÃæ½øÈëÒ»¸öÖص㣬ÄǾÍÊÇÔÚ±í news Ͻ¨Á¢¸÷¸ö×ֶΡ£
ÄÇô£¬Ê²Ã´½Ð×Ö¶ÎÄØ£¿Í¨Ë׵㣬¾ÍÊÇÒ»ÀàÊÂÎïµÄ×ܳơ£±ÈÈç˵£¬ËùÓеÄÐÂÎÅ·¢±íʱ¼äÓÃÒ»¸öÃû´ÊÀ´´ú±í£¨´ÓżµÄ¾ÑéÀ´¿´ ......
// Á¬½ÓÁ½¸ö×Ö·û´®
<?php
$txt1 = "Hello";
$txt2 = "PHP";
echo $txt1." ".$txt2;
?>
// È¡µÃ×Ö·û´®ÖеÄ×Ö·ûÊý
<?php
$txt1 = "Abc";
echo strlen($txt1);
......
PHP File Îļþ¸ñʽ
³£¹æ
¶ÔÓÚÖ»°üº¬ÓÐ PHP ´úÂëµÄÎļþ£¬½áÊø±êÖ¾£¨"?>"£©ÊDz»ÔÊÐí´æÔڵģ¬PHP×ÔÉí²»ÐèÒª£¨"?>"£©, ÕâÑù×ö, ¿ÉÒÔ·ÀÖ¹ËüµÄĩβµÄ±»ÒâÍâµØ×¢ÈëÏàÓ¦¡£
ÖØÒª£º ÓÉ __HALT_COMPILER() ÔÊÐíµÄÈÎÒâµÄ¶þ½øÖÆ´úÂëµÄÄÚÈݱ» Zend Framework ÖÐµÄ PHP Îļþ»òÓÉËüÃDzúÉúµÄÎļþ½ûÖ¹¡£ Õâ¸ö¹¦ÄܵÄʹÓÃÖ»¶ÔһЩ ......
PHP×÷ΪÓŵãºÍȱµã¶¼·Ç³£Í»³öµÄ±à³ÌÓïÑÔ£¬ÊÇ·ñÍƳçʹÓÿò¼Ü£¬ÖÁ½ñÈÔ´æÓÐÒìÒ顣Ȼ¶øÔÚÕâ¸ö×·Çó¾¼ÃЧÒæ×î´ó»¯µÄ½ñÌ죬½µµÍÈí¼þ¿ª·¢³É±¾£¬Ëõ¶Ì¿ª·¢Ê±¼ä£¬ÒѳÉΪ±ØȻ֮ÊÆ£¬PHP³ÌÐò¿ª·¢Ê¹Óÿò¼ÜÒ²¾Í˳Àí³ÉÕ¡£
ÁзòÍжû˹̩Ôø˵£º“ÐÒ¸£µÄ¼ÒÍ¥ÊÇÏàËƵģ¬²»ÐҵļÒÍ¥¸÷Óи÷µÄ²»ÐÒ”¡ ......