http://www.enbloc.sgで自分のサイトを適切に起動できません
これは、私のプログラマーが問題を理解できないためです。どんな助けでも大歓迎です。
訪問者は、信号機の1つの色をクリックして投票します。彼らは1票しか持たないことになっています。
サイトは最初にCookieをチェックし、次に投票者のIPアドレスをチェックします。2が前の訪問者と同一である場合、投票は許可されません。2つのうち1つだけが繰り返される場合、投票は許可されます。
二重の制限を設けるという考え方は、固定IPの背後にいるさまざまな投票者が投票できるようにすることです。たとえば、会社の従業員は、固定IPアドレスを介してサイトにアクセスする可能性が高いため、投票できません。
ただし、現在、訪問者は3色すべてをクリックして、サイトへの最初の訪問時に3票を登録することができます。私のコーダーはこの問題を解決できず、私を放棄しました。
誰かが助けてくれたらとてもありがたいです。関連するコードが以下に追加されていると思います。
投稿の形式が間違っている場合はお詫びします。
どうもありがとう、Lin En
http://www.enbloc.sg/js/functions.jsから抽出
//update dashboard when vote by user
function vote_update(ip_address, issue_num, vote_status){
var vote_cookie = document.getElementById('vote_cookie').value;
if(vote_cookie != '')
{
if(document.getElementById('thanks').style.display == "none")
{
$("#multi_error").fadeIn("slow");
}
else
{
document.getElementById("thanks").style.display = "none";
$("#multi_error").fadeIn("slow");
}
}
else
{
if(ip_address != ' ' && issue_num != ' ')
{
http.open("POST", "update_vote.php"); // true
http.onreadystatechange = update_vote;
http.setRequestHeader("Content-Type", "application/x-www-form- urlencoded;charset=UTF-8");
http.send("ip="+ ip_address +"&issue_num="+ issue_num + "&vote_status=" + vote_status);
}
else
{
alert("Occur Error for IP or ISSUE!");
}
}
}
// ajax response function
function update_vote(){
if (http.readyState == 4)
{
if (http.status == 200)
{
var xmlDoc = http.responseXML;
var listElements = xmlDoc.getElementsByTagName("list");
var result = listElements[0].getElementsByTagName("total") [0].childNodes[0].nodeValue;
if (result == 1)
{
var issue_num = listElements[0].getElementsByTagName("issue")[0].childNodes[0].nodeValue;
var vote = listElements[0].getElementsByTagName("vote") [0].childNodes[0].nodeValue;
$("#thanks").fadeIn("slow");
load(issue_num, vote);
}
else if (result == 'Multi')
{
if(document.getElementById('thanks').style.display == "none")
{
$("#multi_error").fadeIn("slow");
}
else
{
document.getElementById("thanks").style.display = "none";
$("#multi_error").fadeIn("slow");
}
}
else
{
alert("error");
}
}
}
}