Page load a different domain names cross-domain problem solving

PHP crawl through the pages displayed

<?php
$url
= 'http://www.baidu.com'; $content = file_get_contents($url); $content = str_replace('/static/',$url .'/static/',$content); $content = str_replace('/index.php',$url.'/index.php',$content); echo $content;

The console will generate an error when cross-domain page click function
but it would at least ensure that the page or click on the pop-layer effect can be used normally

Guess you like

Origin www.cnblogs.com/phper8/p/12093219.html