php/js常用函数

    function thecode(){

        if ((event.ctrlKey)&&(event.keyCode==78)){   //屏蔽 Ctrl+n  

    event.returnValue=false;  

        }

    }

 

    $(document).ready(function(){

        $(document).bind("contextmenu",function(e){

            return false;//屏蔽右键

        });

  《body onkeydown="thecode();" oncontextmenu="return false" onselectstart="return false" ondragstart="return false" onbeforecopy="return false" oncopy=document.selection.empty() onselect=document.selection.empty()>


 





PHP:
function curlGetContent($url, $data, $method='POST')
{
    if(!function_exists('curl_init')) return false;
    if(empty($url)) return false;
    if($method == 'POST' && empty($data)) return false;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_TIMEOUT,30);
    curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.168 Safari/535.19");
    curl_setopt($ch, CURLOPT_REFERER, $url);
    if($method == 'POST'){
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
     }
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
     curl_setopt($ch, CURLOPT_HEADER, 0);

     $content = curl_exec($ch);
     curl_close($ch);

     return $content;
}

 

300*300
 文章首页关于迷茫时代关于我写意人生
版权所有:迷茫时代 All rights reserved   
执行时间:0.00495 秒