franlaw wrote:My problem is how I can make a php program to fill in the login window (from Apache) like a human?
Basically what you'll have to do is use PHP sockets to open a connection to the server and request the page. The server will then send back headers with a challenge, at which point you'll have to send back the username and password. This is not easy, and I won't explain how to do it. Instead, I'll refer you to the spec:
HTTP/1.0 -- 11. Access Authentication
Believe me, it's a charming read. You're going to learn way more about HTTP headers than you ever wanted to. Below are some PHP classes which may help you in dealing with the HTTP angle:
PHPClasses.org search for "HTTP"
You'll have to register to download any of them, but it's worth it. Good luck.