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');
Ïà¹ØÎĵµ£º
Ç°ÑÔ£º
¡¡¡¡FCKeidtorÊǸö¹úÍâµÄ¶àÓïÑÔ±à¼Æ÷£¬Äã¿ÉÒÔ¶ÔÆäÅäÖÃÎļþ½øÐмòµ¥ÐÞ¸Äʹ֧֮³ÖÄ¿Ç°³£ÓÃWeb¿ª·¢ÓïÑÔµÄÓ¦Óã¬ÏÂÃæÎҾͽ²½²FCKeditorµÄ×îа汾2.4.2ÔÚphpµÄ¾ßÌåÅäÖùý³Ì£¬Óв»×ãºÍ³ö´íµÄµØ·½£¬»¶ÓÖ¸Õý¡£
¾«¼ò£º
¡¡¡¡ÕýÒòΪÕâ¸ö±à¼Æ÷ÊÇÖ§³Ö¶àÓïÑԵģ¬ËùÒÔÊ×ÏÈÎÒÃÇÕë¶ÔʹÓöÔÆä×öÏàÓ¦µÄÈßÓàÎļþɾ³ý¡£
¡¡¡ ......
JavaScript ==> PHP£º
·½·¨Ò»: ÏÈÓÃPHPÉú³Éjs´úÂ룬Ȼºóͨ¹ýä¯ÀÀÆ÷µÄ×Ô¶¯Ë¢Ð£¬½«javascript±äÁ¿´«µÝµ½PHP½Å±¾ÖС£
×¢Ò⣺ÔÚʵ¼ÊÓ¦ÓÃÖÐÒª·ÀÖ¹Óû§ÔÚµØÖ·À¸ÄÚ¸ü¸Ä´«µÝµÄ±äÁ¿Öµ¡£
<?php
if($qq) echo $qq.'<br>';
else echo "<scrip ......
__FILE__ ·µ»Øµ±Ç° ·¾¶+ÎļþÃû
dirname(__FILE__) ·µ»Øµ±Ç°Îļþ·¾¶µÄ ·¾¶²¿·Ö
dirname(dirname(__FILE__));µÃµ½µÄÊÇÎļþÉÏÒ»²ãĿ¼Ãû£¨²»º¬×îºóÒ»¸ö“/”ºÅ£© ......
¶Ôhttp request¹ýÀ´µÄÊý¾Ý£¬·²ÊǺ¬Óе¥ÒýºÅ£¬Ë«ÒýºÅ£¬·´Ð±Ïߵȶ¼½øÐмÓбÏß´¦Àí¡£·ÀÖ¹½øÐÐ×¢Èë²Ù×÷¡£
/*
¶ÂSQL©¶´
*/
function quotes($content){
//Èç¹ûmagic_quotes_gpc=Off£¬ÄÇô¾Í¿ªÊ¼´¦Àí
if (!get_magic_quotes_gpc()) {
//ÅжÏ$contentÊÇ·ñΪÊý×é
if (is_array($content)) {
//Èç¹û$contentÊÇ ......
function mysql_conn(){
$conn=mysql_pconnect('localhost','root','root');
mysql_select_db('liuyan');
mysql_query('set names utf8');
return $conn;
}
//$sqlΪSQLÓï¾ä£»$pageΪµÚ¼¸Ò³£¬$pagesizeΪһҳÏÔʾ¶àÉÙÌõ
//×îºó½«·µ»ØÒ»¸öarrayµÄÊý¾ÝÀàÐÍ,ÀïÃæ°üº¬$arr['result']£¬$arr['fypage']
function page ......