Use AJAX to push the link through to the page they requested.
PHP Code:
<script type="text/javascript">
function sendVote(selection){
var ajaxRequest;
try{
ajaxRequest = new XMLHttpRequest();
} catch (e){
try{
ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try{
ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e){
alert("Your browser does not support AJAX!");
return false;
}
}
}
var url = "URL OF PAGE HERE";
var qstring = document.getElementById("question").value;
ajaxRequest.open("POST", url, true);
ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
ajaxRequest.setRequestHeader("Content-length", selection.length);
ajaxRequest.setRequestHeader("Connection", "close");
ajaxRequest.onreadystatechange = function(){
if(ajaxRequest.readyState == 4){
document.getElementById("imgdiv").innerHTML = "Thanks for voting!";
}
}
ajaxRequest.send(qstring);
}
</script>
Now just make the left something like:
<a href="#" onclick="sendVote('left');"></a>
and the right
<a href="#" onclick="sendVote('left');"></a>
Bookmarks