Home > Backend Development > PHP Tutorial > curl函数解决方法

curl函数解决方法

WBOY
Release: 2016-06-13 12:44:48
Original
895 people have browsed it

curl函数
function search($url,$curlPost){
$cookiejar = realpath ( 'cookie.txt' );
$ch = curl_init ();
curl_setopt ( $ch, CURLOPT_URL, $url);
curl_setopt ( $ch, CURLOPT_HEADER, 0 );
curl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ( $ch, CURLOPT_POST, 1 );
curl_setopt ( $ch, CURLOPT_POSTFIELDS, $curlPost );
curl_setopt ( $ch, CURLOPT_COOKIEJAR, $cookiejar ); // 要回传cookie
$data=curl_exec ( $ch );
curl_close ( $ch );
return $data;
 }
?>

我想用PHP实现外网机器通过我的电脑访问内网的资源,一张截图是我在内网登录内网的网站的数据交互截图,另一张是通过我的PHP文件用curl函数访问时的截图,它提示少了什么文件。请问有人知道怎么解决吗

Curl PHP
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template