mediawiki api call to login user from an external script using a javascript xmlhttprequest
echo ' <html><head></head><body> <script> <!-- var params="action=login&lgname='.htmlspecialchars($username).'&lgpassword='.$password.'"; var url="'.$wikirurl.'api.php"; var req = new XMLHttpRequest(); req.open("POST", url, false); req.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); req.setRequestHeader("Content-length", params.length); req.setRequestHeader("Connection", "close"); req.send(params); window.location.href = "'.htmlspecialchars($returnto).'"; --> </script> <noscript> Your Browser doesnt support JavaScript. No problem. <a href="'.$returnto.'">→ Continue here ←</a> </noscript> </body> </html> ';