我需要从服务器更新数据库,但我必须在浏览器句柄中打开url。在浏览器上没有打开url的情况下,我如何请求url?
javascript部分内部:xmlhttp.open("GET","some_page_name.xyq",true);
更多信息
您可以在PHP中使用CURLhttp://php.net/manual/ru/function.curl-init.php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
或者,您可以在PHP中使用函数file_get_content。
$content = file_get_contents('http://www.example.com/');
或者你可以使用PHP 中的一些linux函数
system("wget -N -O - 'http://google.com")