search
Homephp教程php手册如何跨站抓取别的站点的页面的补充,抓取站点页面

如何跨站抓取别的站点的页面的补充,抓取站点页面

在实际的应用中,经常会遇到一些特殊的情况,比如需要新闻,天气预报,等等,但是作为个人站点或者实力小的站点 我们不可能有那么多的人力 物力 财力去做这些事情,怎么办呢?  
好在互联网是 资源共享的,我们可以利用程序 自动的把别的站点的页面抓取回来经过处理后被我们所利用。 
  用什么呢,那个战友给的是不行的,其实在Php有这个功能,那就是用curl库。请看下面的代码!  

$ch = curl_init ("http://dailynews.sina.com.cn"); 
$fp = fopen ("php_homepage.txt", "w"); 

curl_setopt ($ch, CURLOPT_FILE, $fp); 
curl_setopt ($ch, CURLOPT_HEADER, 0); 

curl_exec ($ch); 
curl_close ($ch); 
fclose ($fp); 
?> 

详细说明:http://php.662p.com/thread-504-1-1.html

问怎解决跨站问题?


改为

即可
 

vps上面放多个网站,怎设置目录安全可以防止跨站入侵?

一个网站设置一个权限,这样即使A网站被入侵,也无法跨站入侵B网站。如果不太懂,建议安装主机管理系统,比如免费的N点主机管理系统。这样开通的空间自动帮你分配了一个权限。
 

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools