【发布时间】:2015-10-15 13:16:15
【问题描述】:
我目前正在构建一个 CMS。我想在重定向时将 page-id 或 site-id 发送到下一页。我尝试使用 jQuery POST 函数:
$(document).ready(function(){
$('.sender').on('click','a',function(){
var url = $(this).attr('href');
var n = url.indexOf('#')+1;
var siteid = url.substr(n,url.length);
$.ajax({
url: 'pages.php',
type: 'POST',
data: { siteid:siteid },
success: function(response){
console.log('check');
},
error: function(){
console.log('error');
}
});
});
});
但是因为请求是和重定向同时发送的,所以好像不起作用。
因为我使用 apache rewrite_engine 来重定向东西,所以我不能使用 GET。
除了 session_variables,我还有哪些选择? 我想保证它的安全,所以我不希望太多信息可见/可用!
【问题讨论】: