htmldoc with login on page

How can I make htmldoc write to pdf page that requires login and password?
I'am doing it with PHP passthru. I have my login but htmldoc in passthru is showing me only login page.

Your question is rather ambiguous. Are you trying to create a password protected pdf file from a html file using htmldoc? Or, are you trying to log into a web site in order to create a pdf file?

I'am sorry about my english.

  1. I have page login.html
  2. I have page templet.html
  3. I have PHP script pdfdoc.php

To read templet.html I need to login at login.html.
In pdfdoc.php

$myurl =curPageURL();
passthru("htmldoc -t pdf --quiet --webpage $myurl");

Instend getting template.html I get login.html. To do it right I need to provide login and password.

Of course everything is simplified. I can't explaine it straighter.

replace $myurl with templet.html in the passthru statement

It was simplified. One thing is that this url is generated so it have to be like it is.
Second I made it from console with right url

htmldoc -t pdf --quiet --webpage templet.html

and it give me login page not templet. Again how to pass login data or avoid login using PHP?