我有一个脚本,在我的客户页面上
<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”值并如您所见发送。