轉到http://oxidepkz.net63.net/vote.php 這就是完整的PHP文件看起來像什麼,所以最新錯誤是我有一個用戶名,假設進入MySQL數據庫。用戶名是文本框,我想我需要的是從按鈕點擊的URL中的用戶名,而不是實際的PHP頁面。 這裏是腳本代碼的片段:JavaScript不會把用戶名在URL
<script>
function next() {
if(document.vote.username.value.length == 0) {
alert("The username field cannot be left empty.");
} else if(document.vote.username.value.length > 30) {
alert("You've reached the maximum amount of characters.");
} else {
document.vote.username.disabled = true;
document.getElementById('button').style.display = "block";
document.getElementById('nextbutton').style.display = "none";
}
}
function changeAction(url) {
if(url.indexOf("rspscoding.org") != -1) {
var username = document.vote.username.value;
document.vote.action = ""+url+"&username="+username+"";
} else {
document.vote.action = url;
}
}
</script>
<title>Vote</title>
</head>
<body>
<center><br>
<br><br>
<div class="vote"><br><br>
<form name="vote" class="short style" method="post" target="_blank">
<input name="username" type="text" size="30" maxlength="30" placeholder="Username"><button id="nextbutton" type="button" onClick="next();">Next</button>
<div style="display: none;" id="button" class="button"><button type="submit" onClick="changeAction('http://www.rune-server.org/toplist.php?do=vote&sid=8289&name=');")>Rune-Server</button><button type="submit" onClick="changeAction('http://www.runelocus.com/toplist/index.php?action=vote&id=30838&id2=');")>RuneLocus</button></div>
</form><br>
「請訪問http://oxidepkz.net63.net/vote.php」編號 –
請不要評論某些無用的東西謝謝,它的鏈接可以查看完整的投票頁面,而不是評論「否「。 – Oxide
請不要讓人們訪問您的隨機/粗略網站訪問您的問題的代碼。如果相關,請在此處發佈。 –