ÍøÕ¾Ä£ÄâµÇ½±¸Íü£¨php + python£©
php°æ£º
<?php
$cookie_file = fopen('cookie.txt','w');//dirname(__FILE__)."/cookie_".md5(basename(__FILE__)).".txt"; // ÉèÖÃCookieÎļþ±£´æÂ·¾¶¼°ÎļþÃû
function vlogin($url,$data){ // Ä£ÄâµÇ¼»ñÈ¡Cookieº¯Êý
$curl = curl_init(); // Æô¶¯Ò»¸öCURL»á»°
curl_setopt($curl, CURLOPT_URL, $url); // Òª·ÃÎʵĵØÖ·
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // ¶ÔÈÏÖ¤Ö¤ÊéÀ´Ô´µÄ¼ì²é
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1); // ´ÓÖ¤ÊéÖмì²éSSL¼ÓÃÜËã·¨ÊÇ·ñ´æÔÚ
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // Ä£ÄâÓû§Ê¹ÓõÄä¯ÀÀÆ÷
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); // ʹÓÃ×Ô¶¯Ìø×ª
curl_setopt($curl, CURLOPT_AUTOREFERER, 1); // ×Ô¶¯ÉèÖÃReferer
curl_setopt($curl, CURLOPT_POST, 1); // ·¢ËÍÒ»¸ö³£¹æµÄPostÇëÇó
curl_setopt($curl, CURLOPT_POSTFIELDS, $data); // PostÌá½»µÄÊý¾Ý°ü
curl_setopt($curl, CURLOPT_COOKIEJAR, $GLOBALS['cookie_file']); // ´æ·ÅCookieÐÅÏ¢µÄÎļþÃû³Æ
curl_setopt($curl, CURLOPT_COOKIEFILE, $GLOBALS['cookie_file']); // ¶ÁÈ¡ÉÏÃæËù´¢´æµÄCookieÐÅÏ¢
curl_setopt($curl, CURLOPT_TIMEOUT, 30); // ÉèÖó¬Ê±ÏÞÖÆ·ÀÖ¹ËÀÑ»·
curl_setopt($curl, CURLOPT_HEADER, 0); // ÏÔʾ·µ»ØµÄHeaderÇøÓòÄÚÈÝ
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // »ñÈ¡µÄÐÅÏ¢ÒÔÎļþÁ÷µÄÐÎʽ·µ»Ø
$tmpInfo = curl_exec($curl); // Ö´ÐвÙ×÷
if (curl_errno($curl)) {
echo 'Errno'.curl_error($curl);
}
curl_close($curl); // ¹Ø±ÕCURL»á»°
return $tmpInfo; // ·µ»ØÊý¾Ý
}
function vget($url){ // Ä£Äâ»ñÈ¡ÄÚÈݺ¯Êý
$curl = curl_init(); // Æô¶¯Ò»¸öCURL»á»°
curl_setopt($curl, CURLOPT_URL, $url); // Òª·ÃÎʵĵØÖ·
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); // ¶ÔÈÏÖ¤Ö¤ÊéÀ´Ô´µÄ¼ì²é
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1); // ´ÓÖ¤ÊéÖмì²éSSL¼ÓÃÜËã·¨ÊÇ·ñ´æÔÚ
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); // Ä£ÄâÓû§Ê¹
Ïà¹ØÎĵµ£º
ת×Ô http://hi.baidu.com/xunxun129/blog/item/3befad0f8ff992c07bcbe180.html
ÓÐʱÎÒÃÇÐèÒªÔÚ Python
ÖÐʹÓà zip Îļþ£¬¶øÔÚ1.6°æÖУ¬Python ¾ÍÒѾÌṩÁË zipfile Ä£¿é¿ÉÒÔ½øÐÐÕâÑùµÄ²Ù×÷¡£²»¹ý Python ÖеÄ
zipfile Ä£¿é²»ÄÜ´¦Àí¶à¾íµÄÇé¿ö£¬²»¹ýÕâÖÖÇé¿ö²¢²»¶à¼û£¬Òò´ËÔÚͨ³£Çé¿öÏÂÒѾ×㹻ʹÓÃÁË¡£ÏÂÃæÎÒÖ»Ê ......
²Ù×÷ϵͳcentos 5.3£¬php 5.1.6, xdebug 2.0.5¡£
Ö÷Òª²Î¿¼Îĵµ£º
xdebugµÄ°²×°Îĵµ£ºhttp://xdebug.org/docs/install¡£
xdebugµÄÔ¶³Ìµ÷ÊÔÅäÖÃÎĵµ£ºhttp://xdebug.org/docs/remote
Using vim and xdebug DBGp for debugging Drupal (or any PHP application)£º
http://2bits.com/articles/using-vim-and-xdebug- ......
1.echo()ÊÇÒ»¸öphpÓï¾ä£¬ËùÒÔûÓзµ»ØÖµ£¬ÄÜ´òÓ¡¼òµ¥µÄÊý¾Ý¡£
2.print()ÊÇÒ»¸öº¯Êý£¬Óзµ»ØÖµ£¬ÄÜ´òÓ¡¼òµ¥µÄÊý¾Ý¡£
3.print_r()ÊÇÒ»¸öº¯Êý£¬ÄÜ´òÓ¡¸´ÔÓµÄ(mix)Êý¾Ý¡£
È磺
<?
$value = print 'hello word<br>';
echo "the value is $value<br>";
$arr = array('name'=>'wangking','qq'=>'12345 ......
¿ÉÒÔ½«Êý×éºÍ¶ÔÏóÖ±½Ó´æÈëÊý¾Ý¿âÖеÄijһ×ֶΡ£
ʹserialize()Êǽ«Êý×é·´ÐòÁл¯ÔÙ´æÈëÊý¾Ý¿â£¬ÐòÁл¯»°ÍêµÄÊý¾Ý¾ÍÊÇÒ»¸ö×Ö·û´®¡£
ÌáÈ¡µÄʱºò£¬ÓÃunserialize()·´ÐòÁл¯È¡£¬È¡³öÀ´µÄ»¹ÊǸöÊý×é¡£
$arr = array('value1','value2','value3');
$str = serialize($arr); //ÐòÁл¯
$new_str = unserialize($temp); //·´ÐòÁÐ ......