<?php
$curl = curl_init();
$url = \'http://www.phpstudy.net/admin/gateway/login\';
$data = array(
\'username\'=>\'admin\',
\'password\'=>\'123\'
);
$cookie = tempnam(\'./temp\',\'cookie\');
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_POST,count($data));
curl_setopt($curl,CURLOPT_POSTFIELDS,$data);
curl_setopt($curl,CURLOPT_COOKIEJAR,$cookie);
ob_start();
curl_exec($curl);
$result = ob_get_contents();
ob_end_clean();
curl_close($curl);
本文地址:https://www.stayed.cn/item/10346
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我