php»ñÈ¡ÍøÕ¾µÄÄÚÈÝ(SSL,GET,POSTÐÎʽ¶¼ÄÜ»ñÈ¡µ½)!
·â×°Ò»¸öfunction£¬ÒԱ㸴Óá£
Ö§³Öhttps£¬»òÕßhttpµÄget»òÕßpost¡£
function httpURLfeedback($url,$request_type,$time_out = "60") {
$arr = parse_url($url);
$transports = "";
$port = 0;
$host = $arr['host'];
$query = $arr['query'];
$path = $arr['path'];
if($urlarr["scheme"] == "https") {
$transports = "ssl://";
$port = "443";
} else {
$transports = "tcp://";
$port = "80";
}
$fp=@fsockopen($transports.$host,$port,$errno,$errstr,$time_out);
if(!$fp) {
die("ERROR: $errno - $errstr<br />\n");
} else {
$out = "";
if($request_type == 'get'){
$out .= "GET $path?$query HTTP/1.1\r\n";
$out .= "Host: $host\r\n";
$out .= "Connection: Close\r\n\r\n";
}else {
$out .= "POST $path HTTP/1.1\r\n";
$out .= "Host: $host\r\n";
$out .= "Content-type: application/x-www-form-urlencoded\r\n";
$out .= "Content-length: ".strlen($query)."\r\n";
$out .= "Connection: Close\r\n\r\n";
$out .= $query. "\r\n\r\n";
}
fwrite($fp,$out);
while(!feof($fp)) {
echo @fgets($fp, 1024);
}
fclose($fp);
}
}
httpURLfeedback("http://www.baidu.com/s?wd=wwe",'get');
Ïà¹ØÎĵµ£º
phpÖÐsessionµÄÓ÷¨
PHPÖеÄsessionĬÈÏÇé¿öÏÂÊÇʹÓÿͻ§¶ËµÄCookie¡£µ±¿Í»§¶ËµÄCookie±»½ûÓÃʱ£¬»á×Ô¶¯Í¨¹ýQuery_StringÀ´´«µÝ¡£
Php´¦Àí»á»°µÄº¯ÊýÒ»¹²ÓÐ11¸ö£¬ÎÒÃÇÏêϸ½éÉÜһϽ«ÒªÓõ½¼¸¸öº¯Êý¡£
1¡¢ session_start
º¯Êý¹¦ÄÜ£º¿ªÊ¼Ò»¸ö»á»°»òÕß·µ»ØÒѾ´æÔڵĻỰ¡£
º¯ÊýÔÐÍ£ºboolean se ......
´î½¨ PHP Æäʵ²»ºÜÄÑ£¬Ö»ÊÇÓе㷱Ëö¡£ÒªÊÇ×Ô¼º´î½¨Ò»´Î PHP + MySQL »·¾³ºÜÊÇ·Ñʱ¡£¸üÔãµÄÊÇ£¬ºÜ¶àÐÂÊÖÔÚÅäÖà PHP
ʱ³£³£³öÏÖÕâÑùÄÇÑùµÄÎÊÌâ¡£ÖîÈç mysql À©Õ¹¡¢zend °²×°Ê§°ÜµÈµÈÎÊÌâ¡£Õâʱ£¬ÎÒÃÇÐèÒªÒ»¸ö¿ìËÙ¡¢±ê×¼ÇÒרҵµÄ PHP
Ì×¼þ°ü¡£PHPnow ¾ÍÕâÑùÓ¦Ô˶øÉú£¬ÎªÄã¿ìËٴרҵµÄÐéÄâÖ÷»ú¡£
Óë PHPnow µÄÃû×ÖÒ ......
¶Ôhttp request¹ýÀ´µÄÊý¾Ý£¬·²ÊǺ¬Óе¥ÒýºÅ£¬Ë«ÒýºÅ£¬·´Ð±Ïߵȶ¼½øÐмÓбÏß´¦Àí¡£·ÀÖ¹½øÐÐ×¢Èë²Ù×÷¡£
/*
¶ÂSQL©¶´
*/
function quotes($content){
//Èç¹ûmagic_quotes_gpc=Off£¬ÄÇô¾Í¿ªÊ¼´¦Àí
if (!get_magic_quotes_gpc()) {
//ÅжÏ$contentÊÇ·ñΪÊý×é
if (is_array($content)) {
//Èç¹û$contentÊÇ ......
Ò»¡¢Ç°Ìá
ÎÒÃÇÐèÒªÒ»¸ö Web ·þÎñÆ÷À´½âÎöÓà PHP ´´½¨µÄÒ³Ãæ²¢°ÑËüÃÇÏÔʾµ½ä¯ÀÀÆ÷¡£±¾ÎÄÖÐʹÓõÄÊÇ Apache2¡£µ«ÊÇ£¬ÈκΠWeb ·þÎñÆ÷¶¼¿ÉÒÔÂú×ãÒªÇó¡£
ÒªÀûÓñ¾ÎÄÖнéÉܵÄһЩµ÷ÊÔ¼¼Êõ£¬ÐèÒª°²×° Eclipse V3.1.1 ºÍ²å¼þ PHPEclipse V ......