window.open(\"index.php\"); does not open the new page in the same tab, it opens it in a new tab.
window.open(\"index.php\");
I tried window.open(\"index.php\",
window.open(\"index.php\",
Instead of window.open you should use window.location = "http://...."
window.open
window.location = "http://...."