The PHP PGBrowser library can do this quite easily. The following is a snippet of demo code taken from a companion blog . I believe this will not work with the XBox website, because Microsoft now uses SSO, but is still applicable to other sites with login form contents.
require 'pgbrowser.php'; $b = new PGBrowser(); $b->useCache = true; $page = $b->get('http://yoursite.com/login'); // Retrieve login web page $form = $page->forms(1); // Retrieve form // Note the form field names have to be specified $form->set('username', "your_username_or_email"); $form->set('password', "your_password"); $page = $form->submit(); // Submit form echo $page->html; // This shows the web page normally displayed after successful login, eg dashboard
source share