小编典典
我已经解决了问题…没有会话且没有Cookie的HURRAHHH
该解决方案是PHP:AJAX:JavaScript的组合
您想在页面加载而不是页面刷新上运行的查询通过AJAX调用运行,可以说我执行此操作的功能是
function runQUERY()
{
xmlhttp=new XMLHttpRequest();
xmlhttp.open("POST","doIT.php",false);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send();
}
我可以通过执行以下操作简单地使用Javascript检查该页面是否是新加载或刷新
function checkRefresh()
{
if( document.refreshForm.visited.value == "" )
{
// This is a fresh page load
alert ( 'Fresh Load' );
document.refreshForm.visited.value = "1";
..call you AJAX function here
}
else
{
// This is a page refresh
alert ( 'Page has been Refreshed, The AJAX call was not made');
}
}