You might be able to use the browser logs in a debugger like Chrome Dev Tools or Firebug (for Firefox). This will at least show you what the browser thinks it is sending to your server. It will not show you what the server thinks that it is receiving though.
I don't know PHP, so I can't help you with the code itself, sorry.
The general idea though is to write those variables to a file on your server (which may be your computer if you are running the PHP on your computer), but PHP -- unlike JavaScript -- can write files to computers. Then you can open up that file and see if the username and password are correct.