-
- <script>window.sc="<img src='http://cdn.jbxue.com//uploads/2011/06/1309476244-elicium-rai-01-528x351.jpg?" +Math.random()+"'>";</script>
-
Copy code
2. Curl method
usage:
-
- http://your-domain-name/showpic.php?url=image_url
Copy code
3. PHP header sends various types of files for download
File name: showpic.php
-
- $url = $_GET["url"];
- //$url = str_replace("http://","http://",$url);
- $dir = pathinfo($url);
- $host = $dir['dirname'];
- $refer = $host.'/';
-
- $ch = curl_init($url);
- curl_setopt ($ch, CURLOPT_REFERER, $ refer);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);//Activation can modify the page
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
- $ data = curl_exec($ch);
- curl_close($ch);
-
- $ext = strtolower(substr(strrchr($img,'.'),1,10));
- $types = array(
- 'gif' =>'image/gif',
- 'jpeg'=>'image/jpeg',
- 'jpg'=>'image/jpeg',
- 'jpe'=>'image/jpeg',
- ' png'=>'image/png',
- );
- $type = $types[$ext] ? $types[$ext] : 'image/jpeg';
- header("Content-type: ".$type ; !
-
- With the above code, you can display the image like this:
-
Copy code
It’s really a step up from the top, and the PHP image hotlink protection can’t hold the line of defense like this, haha.
-
-
|