我有一个脚本,在客户网页上我有将数据发送到java.js页然后将其发送到另一个页面
<a href='hueimx.php?action=edit&uid={$result['uid']}'>click to edit</a>
和
{$result['uid']}
这是一个客户ID,我从数据库中获得。
现在我想在我的javascript页面上收到“uid”值。这是我的代码:
function insert() {
// Optional: Show a waiting message in the layer with ID login_response
document.getElementById('huemix_message').innerHTML = "<img src='images/saver.gif' />"
// Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding.
var system_name= encodeURI(document.getElementById('system_name').value);
var system_logo = encodeURI(document.getElementById('system_logo').value);
var system_number = encodeURI(document.getElementById('system_number').value);
var system_tel = encodeURI(document.getElementById('system_tel').value);
if($("#system_pics").is(':checked')){
var system_pics = 1;
} else {
var system_pics = 0;
}
if($("#system_bread").is(':checked')){
var system_bread = 1;
} else {
var system_bread = 0;
}
// Set te random number to add to URL request
nocache = Math.random();
// Pass the login variables like URL variable
http.open('get', 'huemixpanel_insert.php?system_name='+system_name+'&system_logo='+system_logo+'&system_number='+system_number+'&system_tel='+system_tel+'&system_pics='+system_pics+'&system_bread='+system_bread+'&uid='+uid+'&nocache = '+nocache);
http.onreadystatechange = insertReply;
http.send(null);
}
在此页面中我收到从设置页面中的所有值,并将其转发到PHP页面将它们插入到数据库中。一切工作正常,但我不知道如何接收“uid”值并按照您所看到的发送它。
不知道如果我完全理解,但如果你只是想跟踪值(如用户ID )在服务器上使用会话变量不是更容易吗? – 2013-03-15 22:12:28
为了在这里得到有用的答案,你必须在你在这里问的问题上付出一些努力。 1.)你在尝试什么? 2.)你期望什么。 3.)而是发生了什么。我们都是volteers,所以帮助我们来帮助你。 – 2013-03-15 22:33:05