If you don't want to use redirects, wait for browser to complete request to click.php
and then go to outer address. Code below may require some tweaks to be cross-browser, I remember some browsers have problems with .click()
method or onreadystatechange()
event.
<script type="text/javascript">
function click(input,aObj){
img = new Image();
img.onreadystatechange = function(){
aObj.onclick = function(){};
aObj.click();
};
img.src = '/click.php?id=' +input;
return false;
}
</script>
<a href="http://www.out.com" target="_blank" onclick="return click('IDinmysql',this)">outlink</a>
Second idea is to open click.php
in pop-up with dimensions 1x1, and make it return <body onload="window.close()"></body>