VBS/Batch file call a remote PHP file silently
I'm going to start work on a quick and simple PHP/Windows logging script that will log every time a user logs in and out of a PC as well as tie the events together so I can see whether or not a student logged off from a particular session.
Anyhoo the PHP wont be an issue, the problem is simply getting that login event to the PHP receiver. There are two obvious solutions I see each with drawbacks. Option one is to make a publicly writeable CSV file on the LAMP server and have the batch file echo straight into it. It's the simplest option by far but the drawback is that to make the data "live" in PHP I would need to read directly from the CSV with a database used for archives, the problems with that are two fold. It's a massive security risk opening the whole server to a clever (albeit it VERY clever) user and files are single access so if the login script runs twice at the same time (IE two users log in) one of the sessions will lock the CSV meaning I get no data from the second session or a corrupted CSV.
The second option which is by far the best is to have my login script hit a PHP page similar to "log.php?user=auser&machine=XYZ" the php will then error check and make the data safe and insert it into a database safely. This gives me safe, accurate data, multiuser/session support and error checking as well as live data when I view the log. The problem being I can't make a script to hit a remote PHP page.
Under linux I could use "wget", I know wget exists for windows but it requires me to deploy wget to all the machines in the school then risk incomplete data if I miss a machine etc... so I am looking for a built in, windows standard for calling a remote webpage without triggering user response or a browser window. I don't need any feedback from the PHP script it will all be silent.