Home >php教程 >php手册 >php 隐藏图片路径

php 隐藏图片路径

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-06 19:59:562113browse

整个过程为异步处里 php function hideAvatar(){ ob_clean(); $file=file_get_contents(url); 这里的url是你图片的真实路径 echo $file; } html img id=img/img js LoadImage(img); function LoadImage(ElementID) { //id 请求的图片ID var url = http://xxx

整个过程为异步处里

php   

          function hideAvatar(){

                         ob_clean();

                           $file=file_get_contents(url);   这里的url是你图片的真实路径

                          echo $file;

       }


html

       php 隐藏图片路径

js    

    LoadImage("img");


function LoadImage(ElementID)
{                                
        //id 请求的图片ID        
        var url = "http://xxx.xxx.xxx/hidehideAvatar?t="+Math.random(); /
        var xhrObject = new XMLHttpRequest();
          
        xhrObject.onreadystatechange = function event()
        {                        
                if (xhrObject.readyState == 4)
                {                
                        if (xhrObject.status == 200)
                        {        
                                document.getElementById(ElementID).src = url;
                                alert(url);
                        }        
                }                
        }                        
        xhrObject.open("get", url);
        xhrObject.send(null);       
}                                
   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn