新聞中心
php如何遠(yuǎn)程調(diào)用asp網(wǎng)站數(shù)據(jù)
1、在asp網(wǎng)站上生成 xml新聞源 php中調(diào)用
創(chuàng)新互聯(lián)建站專注于企業(yè)成都營銷網(wǎng)站建設(shè)、網(wǎng)站重做改版、城西網(wǎng)站定制設(shè)計、自適應(yīng)品牌網(wǎng)站建設(shè)、H5響應(yīng)式網(wǎng)站、商城網(wǎng)站制作、集團公司官網(wǎng)建設(shè)、成都外貿(mào)網(wǎng)站建設(shè)公司、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計等建站業(yè)務(wù),價格優(yōu)惠性價比高,為城西等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。
2、php直接遠(yuǎn)程讀取asp上的網(wǎng)頁 下面發(fā)段php遠(yuǎn)程讀取的函數(shù)
function get_content($url)
{
$buf=parse_url($url);
if($buf['scheme']=="http")//如果是URL
{
$host=$buf['host'];
$page=$buf['path'];
if(trim($buf['query'])!=="") $page.="?".trim($buf['query']);
$myHeader="GET $url HTTP/1.1\r\n";
$myHeader.="Host: $host\r\n";
$myHeader.="Connection: close\r\n";
$myHeader.="Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5\r\n";
$myHeader.="Accept-Language: zh-cn,zh;q=0.5\r\n";
$myHeader.="Accept-Charset: gb2312,utf-8;q=0.7,*;q=0.7\r\n";
$myHeader.="User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.7.6) Gecko/20050226 Firefox/1.0.1 Web-Sniffer/1.0.20\r\n";
$myHeader.="Referer: \r\n\r\n";
$server=$host;
$port=80;
$res="";
if(false!==($fp = @fsockopen ($server, $port, $errno, $errstr, 30)))
{
@fputs ($fp, $myHeader);
while (!@feof($fp)) $res.= @fgets ($fp, 1024);
@fclose ($fp);
}
else return false;
if(strlen($res)==0) return false;
return $res;
}
else//如果是本地文件
{
$fileName=$url;
if(false!==@file_exists($fileName))
{
if(false!==($buf=@implode("",file($fileName)))@strlen($buf)0)
{
return $buf;
}
else return false;
}
else return false;
}
}
求教:PHP中如何遠(yuǎn)程連接ACCESS數(shù)據(jù)庫
通過共享文件夾方式訪問,
如:你的計算機名稱:s1
遠(yuǎn)程:s2
把access放在s2計算機的d:\目錄下
訪問:
\\s2\d$\access數(shù)據(jù)庫名.
遠(yuǎn)程為啥還用access啊,mysql,sqlserver不是都行么
phpstudy下mysql數(shù)據(jù)庫怎么設(shè)置允許通過IP遠(yuǎn)程連接???
第一:更改 “mysql” 數(shù)據(jù)庫里的 “user” 表里的 “host” 項,從”localhost”改稱'%'。
或者新加條記錄,“host” 項為要訪問的ip地址,并授權(quán)。重啟mysql服務(wù)。
第二:在系統(tǒng)防火墻添加例外端口:3306,并允許例外。
錯誤提示:
ERROR 1130: Host '192.168.1.3' is not allowed to connect to this MySQL server
的解決方法:
1。改表法??赡苁悄愕膸ぬ柌辉试S從遠(yuǎn)程登陸,只能在localhost。這個時候只要在localhost的那臺電腦,登入mysql后,更改 "mysql" 數(shù)據(jù)庫里的 "user" 表里的 "host" 項,從"localhost"改稱"%"
1.mysql -u root -pvmware
mysqluse mysql;
mysqlupdate user set host = '%' where user = 'root';
mysqlselect host, user from user;
2. 授權(quán)法。例如,你想myuser使用mypassword從任何主機連接到mysql服務(wù)器的話。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
如果你想允許用戶myuser從ip為192.168.1.3的主機連接到mysql服務(wù)器,并使用mypassword作為密碼
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
3.在window自帶的防火墻里的例外添加3306端口
總結(jié):
mysql -u root -p
mysqluse mysql;
mysqlselect 'host' from user where user='root';
mysqlupdate user set host = '%' where user ='root';
mysqlflush privileges;
mysqlselect 'host' from user where user='root';
第一句是以權(quán)限用戶root登錄
第二句:選擇mysql庫
第三句:查看mysql庫中的user表的host值(即可進(jìn)行連接訪問的主機/IP名稱)
第四句:修改host值(以通配符%的內(nèi)容增加主機/IP地址),當(dāng)然也可以直接增加IP地址
第五句:刷新MySQL的系統(tǒng)權(quán)限相關(guān)表
第六句:再重新查看user表時,有修改。。
重起mysql服務(wù)即可完成。
新聞標(biāo)題:php怎么設(shè)置遠(yuǎn)程數(shù)據(jù) php遠(yuǎn)程加載代碼執(zhí)行
分享URL:http://www.dlmjj.cn/article/dogcgdp.html